JSF Composite Components Where You Want Them
As Ryan Lubke commented in the Facelets Tags vs Composite Components thread, JSF composite components must be kept in the /resources directory in your webapp. This grates against my "package-by-feature" style of programming. I want all my related code together thanks.
Fortunately there are two ways to work around this problem.
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" template="/apps/webcore/tags/selectUser.xhtml"/>JSF Composite Components Where You Want Them
That's not perfect, but it lets me keep all my related code together. To make things a little neater, you can actually use the same namespace for composite components and regular components. Just declare the location of your composite resources directory in the taglib.xml like this:
<facelet-taglib> <namespace>https://rogerkeays.com/webcore</namespace> <composite-library-name>webcore</composite-library-name> </facelet-taglib>
I don't see any reason why composite components should not be able to be added to taglib.xml. If I had it my way, the existing Facelets <tag> feature would just look in the tag file for <cc:implementation> and handle it as a composite component if one is found.
In fact, composite components and tag files should be the same thing.
I guess I'd call myself a problem solver. Either that, or I'm some sort of organic machine designed to convert oxygen into carbon dioxide. You could go either way on that. I'm into languages and stuff. I wrote a book. It's okay, I guess. What else? I like reading, swimming, eating, and playing music. Satisfied? Sheesh.