[ Team LiB ] |
![]() ![]() |
Recipe 22.4 Packaging a Tag Library in a Web ApplicationProblemYou want to make your tag library available in a web application. SolutionPlace your TLD file in WEB-INF or a WEB-INF subdirectory (with the exception of WEB-INF/lib and WEB-INF/classes). Place the tag handler class or classes in WEB-INF/classes. DiscussionPackaging your tag library outside of a JAR file is typically a two-step process:
The next recipe shows how to package your tag library, including the TLD, in a JAR file. See AlsoThe XML schema file for the JSP 2.0 TLD: http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd; Recipe 22.2 and Recipe 22.3 on creating TLD files for tag libraries; Recipe 22.5 on packaging tag libraries in a JAR file; 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.11-Recipe 22.14 on using a JSP 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). ![]() |
[ Team LiB ] |
![]() ![]() |