Basic Model for Custom Tags





Basic Model for Custom Tags

There are three parts to custom tags: The tags, the taglib descriptor, and the tag handler (Figure).

2. Key pieces of JSP custom tags.

graphics/11fig02.gif

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.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows