I'm trying to define some composite components in my web application. According to the tutorials i read, i have to place the xhtml files inside a resource folder located in webcontent. This solution is problematic, given that it would make those files available for public access from an url. Is there a way to put this components inside the web-inf folder, and make the jsf look for the files there? If not, is there another way to avoid direct access?
Thanks.
P.S.: I have looked into this answer, and if i understood BalusC's answer correctly, what I intend to do is possible.
"Composite components" are not exactly the same as "compositions" in the question/answer you found. The OP was clearly talking about compositions as in
<ui:include>
files which are including<ui:componsition>
content.You effectively want to prevent direct access to
/resources
. This can be achieved by adding the following security constraint entry toweb.xml
:As per the upcoming JSF 2.2, this would not be necessary anymore as it allows you to move the whole
/resources
folder into/WEB-INF
by the following configuration entry inweb.xml
: