A TLD file is useful as a descriptive mechanism for providing information on a Tag Library.
It has the advantage that it can be read by tools without having to instantiate objects or load
classes. The approach we follow conforms to the conventions used in other J2EE
The DTD to the tag library descriptor is organized so that interesting elements have an
optional ID attribute. This attribute can be used by other documents, like vendor specific
documents, to provide annotations of the TLD information. An alternative approach, based
on XML name spaces have some interesting properties but it was not pursued in part for
consistency with the rest of the J2EE descriptors.
The official DTD is described at "http://java.sun.com/j2ee/dtds/web jsptaglibrary_1_1.dtd"
Locating a Tag Library Descriptor
The URI describing a Tag Library is mapped to a Tag Library Descriptor file though two
mechanisms: a map in
described using the
element, and a default
Taglib map in web.xml
The map in
is described using the
element of the Web Application
Deployment descriptor in
, as described in the Servlet 2.2 spec and in
http://java.sun.com/j2ee/dtds/web app_2_2.dtd .
element has two subelements:
A taglib is a subelement of web app:
The taglib element provides information on a tag library that is used by a JSP page within the
A taglib element has two subelements and one attribute:
JavaServer Pages 1.1 Specification
November 30, 1999