Recipe 22.13 Packaging the JSP Tag File in a JAR


You want to store the tag file in a JAR file.


Place the tag file in the JAR's META-INF/tags directory or a subdirectory thereof.


Developers commonly distribute tag libraries as JAR files, particularly if they have designed the tag library to be portable. For JSP 2.0-style tag libraries that are using tag files, place the tag file in META-INF/tags or a subdirectory of META-INF/tags . The tag file must have a .tag extension, or a .tagx extension if it's a tag file in XML syntax.

Then place the JAR file in WEB-INF/lib of any web application containing JSPs that will use the tag.

See Also

The JSP 2.0 specification web page:; Recipe 22.2 and Recipe 22.3 on creating TLD files for tag libraries; Recipe 22.4 and Recipe 22.5 on packaging a tag library in a web application; Recipe 22.6 on using the custom tag in a JSP; Recipe 22.7 on handling exceptions in tags; Recipe 22.8 and Recipe 22.9 on creating a simple tag handler; Recipe 22.10 on using the simple tag handler in a JSP; Recipe 22.14 on using a tag tag file based on a tag file; Recipe 22.15 on adding a listener class to a tag library; the custom tag sections of Hans Bergsten's JavaServer Pages , Third Edition (O'Reilly).

Java Servlet & JSP Cookbook
Java Servlet & JSP Cookbook
ISBN: 0596005725
EAN: 2147483647
Year: 2004
Pages: 326 © 2008-2017.
If you may any questions please contact us: