Jan. 23, 2011, 12:37 p.m.
posted by franni
Basic Model for Custom Tags
There are three parts to custom tags: The tags, the taglib descriptor, and the tag handler (Figure).
The tags that are added to a JSP provide the mechanism for how the service of a custom tag is invoked within a JSP.
The taglib descriptor is a file that provides metadata about a set of custom tags that are packaged within a tag library. The file type is .tld, and is frequently referred to as the tld file. The JSP author will include a taglib directive within the JSP to resolve the source for custom tags used within the page and to associate a prefix (namespace) to be used to refer to that set of custom tags within the page. At translation time, the page compiler uses the metadata within the tld file to validate the syntax of its use within the JSP. The page compiler uses the metadata to perform code generation—actually writing Java code to invoke the appropriate methods on the corresponding tag handlers.
The tag handlers are Java classes that provide the runtime behavior for the custom tags.