Section 7.3.5 of the JSP spec mentions something called "container-level taglibs". What this amounts to is global taglib definitions. So, you can place your TLD inside the Tomcat SAR and it will be available to all web applications in the server instance. This feature is considered optional by the spec.
As of JBoss 4.0.2, this feature is implemented and available for use. Just go to deploy\jbossweb-tomcat55.sar\conf\web.xml and you will see something like this in the definition of the JSP servlet:
<!-- Use a custom options class to allow the shared tag lib descriptors to be loaded from jars in the tomcat sar conf/tlds directory. The standard options implementation can only find taglibs based on the class loader classpath. --> <init-param> <param-name>engineOptionsClass</param-name> <param-value>org.jboss.web.tomcat.tc5.jasper.JspServletOptions</param-value> </init-param> <!-- Specify the jars relative to the jbossweb-tomcat55.sar that should be scanned for common tag lib descriptors to include in every war deployment. --> <init-param> <description>MyFaces tlds</description> <param-name>tagLibJar0</param-name> <param-value>jsf-libs/myfaces-impl.jar</param-value> </init-param>
You can add your own TLD jar relative to jbossweb-tomcat55.sar and then add a new init-param like this. The param-name must start with "tagLibJar":
<init-param> <description>MyOwn tlds</description> <param-name>tagLibJar1</param-name> <param-value>myTLD/myTLDs.jar</param-value> </init-param>
Also see the jira task for this feature
Referenced by:
Comments