What is Tag library descriptor (TLD)?

What is Tag library descriptor (TLD)?

The custom tags can be implemented or redistributed with tag handlers that are written in Java. These redistributable tags must be in a library called Tag Library Descriptor. The TLD file is an XML file. It contains the information about the tag library and about detailed description in the library. TLDs are handled by the container and also by the development tools of JSP that is to validate the tags.

The extension for the tag library file is .tld and must be packaged in the WEB-INF/ directory or in the /META-INF directory or subdirectory of the tag library packaged in a JAR file or subdirectory of the WAR file. The tag library will be automatically generated by the web container if the file is packaged in /WEB-INF/tags or in a subdirectory.

A tag library file must begin with a root element ‘taglib’ which specifies the schema and the JSP version. For Example:

<taglib xmlns=http://java.sun.com/xml/ns/j2ee
jsptaglibrary_2_0.xsd" version=”2.0”>

JSP page life cycle
A request from a browser is served as servlet in JSP. In this way the lifecycle and certain capabilities of JSP are determined by a servlet.
JSP directives - What are JSP directives?
JSP directives are used to set global values like class declaration, content type etc have scope for entire JSP file. ..
JSP implicit objects - What are different implicit objects of JSP?
JSP implicit objects - There different implicit objects of JSP are pageContext,pageScope,requestScope...
Post your comment