Where to place a facelet tag library descriptor
November 03, 2011 21:11:55 Last update: November 03, 2011 21:11:55
Facelet tag library descriptors can be specified in one of two ways:
- In
web.xml, as<context-param>:<context-param> <param-name>javax.faces.FACELETS_LIBRARIES</param-name> <param-value>/taglibs/tags1.xml;/taglibs/tags2.xml</param-value> </context-param>
wherejavax.faces.FACELETS_LIBRARIESis interpreted as a semicolon (;) separated list of paths, starting with "/" (without quotes). Each entry in the list is a path relative to the web application root, and is interpreted as a facelet XML tag library descriptor.
The parameterfacelets.LIBRARIESis an alias tojavax.faces.FACELETS_LIBRARIESfor backwards compatibility reasons.
- Via auto-discovery, by placing the XML tag library descriptor within a jar on the web application classpath (for example, under the folder
WEB-INF/lib). The file should have a name suffix.taglib.xml, and be placed in theMETA-INFfolder of the JAR file.