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 
technologies.
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"
5.3.1
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 
web.xml
 described using the 
taglib
 element, and a default 
mapping.
5.3.1.1
Taglib map in web.xml
The map in 
web.xml
 is described using the 
taglib
 element of the Web Application 
Deployment descriptor in 
WEB INF/web.xml
, as described in the Servlet 2.2 spec and in 
 http://java.sun.com/j2ee/dtds/web app_2_2.dtd .
A 
taglib
 element has two subelements: 
taglib uri
 and 
taglib location
.
taglib
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 
Web Application.
A taglib element has two subelements and one attribute:
93
JavaServer Pages 1.1 Specification  
November 30, 1999




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.