Editing a web deployment descriptor file for a custom tag library
The web deployment descriptor file can contain a <taglib-uri> and a <taglib-location> tag that maps the URI to the actual TLD file. The <taglib-uri> serves as an alias for the TLD file that is published as WEB-INF/taglib.tld. This enables you to shorten the taglib directive in the JSP file.
Procedure
- Expand your web project in the Enterprise Explorer view of the web perspective.
- Right-click Deployment Descriptor and select Open. The web deployment descriptor editor opens.
- Click the tabs in the editor to edit the deployment descriptor. For more information about these tabs, refer to topics on a web deployment descriptor editor. Use the Source page to edit the web deployment descriptor source directly.
Example
This is an example of <taglib-uri> and <taglib-location>
tags used in a web deployment descriptor file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
</web-app>
<display-name>helloWorld-server</display-name>
<taglib>
<taglib-uri>mytags</taglib-uri>
<taglib-location>WEB-INF/taglib.tld</taglib-location>
</taglib>
</web-app>