JSP CUSTOM TAG LIBRARIES
A JSP author tells the Java parser where to find the Tag Library Descriptor file using a taglib directive. The following taglib directives, when included in a JSP page, indicate that tag libraries exist and where they are located:
<%@ taglib uri="WEB-INF/lib/domutil.tld" prefix="domutil" %>
1. uri: specifies name and location of the TLD file This can be either an absolute or relative URL that refers to the TLD.
2. prefix: indicates the namespace to assign to the library You then use this namespace in front of the tag names of tag elements defined in the TLD. The default namespaces for the domtags.tld and domutil.tld libraries are domino and domutil respectively. Using the defaults, you would refer to the session tag as domino:session and the switch tag as domutil:switch. You can define any word to be the prefix for the tags as long as you consistently use that prefix in your code to refer to them.
Incorporating individual JSP tags in a page
JSP tags are defined in the TLD using the Extensible Markup Language (XML) format. Each tag element includes a set of attributes within its opening and closing tags. The tag element represents a Domino object; its attributes further define the object by qualifying what information it should share about itself with the JSP page.
To include a tag:
1. In the HTML editor, after the page directives and opening <HTML> and <BODY> tags, enter the opening angle bracket of a tag(<), followed by the namespace for the TLD containing the custom tag you want to specify (domino or domutil), a colon(:), then the tag name. For example:
Some tags attributes are required. For example, specifying a value for the name attribute of a form tag is mandatory. See the documentation provided here to find out which attribute values must be supplied for an individual tag.
<domino:viewitem name="Customer"/>
</domino:viewloop>