I am trying to create a facelets taglib. Every tutorial I read so far tells to place the *.taglib.xml
file and the tag files themselves inside the WEB-INF
directory, but none actually says why. If I try to move the tag files to another directory and update the *.taglib.xml
to point to the moved files I get the following TagException
:
/confirmation/fields/ordersearchalternatives.xhtml @33,42 <s:orderSearchAlternatives> null
javax.faces.view.facelets.TagException: /confirmation/fields/ordersearchalternatives.xhtml @33,42 <s:orderSearchAlternatives> null
at com.sun.faces.facelets.tag.UserTagHandler.apply(UserTagHandler.java:144)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
The same happens if the *.taglib.xml
file is moved to another directory and the web.xml
points to that.
It only seems to work if the tags' XHTML files and the taglib descriptor are inside the WEB-INF
directory. What I would like to achieve is to have the taglib descriptor as well as the tags' XHTML files inside e.g. the resources
directory and have the web.xml
file pointing to it.
- Is that possible?
- Is that completely out of best practice?