Deploying Tag Libraries

See Also

To deploy a tag library for use in a web module, you must first package it as a JAR file.

To package a tag library as a JAR file:

  1. In the Filesystems window, right-click the tag library descriptor's (TLD) node.
  2. From the contextual menu, choose Create Tag Library JAR. This action creates a file with a .jar extension. It also creates an associated jarContent file, also called a recipe file, which can be used to add additional classes or packages to the library.

You can deploy a tag library to a web module in three ways:

After you deploy the tag library to a web module, modify the Taglib element in the web module's deployment descriptor (web.xml) so that it maps to the JAR file containing the desired tag library. This procedure is not always necessary. In some cases, the IDE adds the Taglib element automatically.

To test a tag library in place:

  1. If the tag library is not already in a web module, convert the filesystem containing the tag library into a web module using Tools and choose Convert Filesystem into Web Module. Leave the .tld file and the generated and compiled Java tag handler classes in place.
  2. Modify the Taglib element in the deployment descriptor to /<yourTagLib>.tld.
  3. Create a JSP file, and add references to your new tags.
  4. Execute the JSP file.

To cut and paste the JAR File:

  1. In the Explorer, right-click the JAR file to be cut.
  2. From the contextual menu, choose Copy or Cut.
  3. Right-click the WEB-INF/lib directory into which you want to paste the JAR file.
  4. From the contextual menu, choose Paste.
See Also
Using Custom Tag Libraries in Web Modules
Adding a Custom Tag Library from the Filesystem
Web Modules (concepts)

Legal Notices