I’ve got a template in WEB-INF/templates/standardTemplate.xhtml
In my “Web Pages” root, I’ve got an index.xhtml which uses the template via
<ui:composition template="/WEB-INF/templates/standardTemplate.xhtml">
The above works fine.
However I also have another page which uses the same template, but it’s in a subfolder “Web Pages”/messageboard/list.xhtml
It uses exactly the same syntax/paths:
<ui:composition template="/WEB-INF/templates/standardTemplate.xhtml">
But it can’t find the template and renders just the content of list.xhtml (none of the template’s content).
Faces servlet is mapped to “/faces/*”
What am I doing wrong? Tried every variant I can think of but I can’t get the right syntax.
Thanks
As per the comments, you’re seeing
<ui:composition>unparsed in the HTML output.That can only mean that the request URL as you’ve in the browser address bar does not match the URL pattern of the
FacesServlet. Make sure that it matches the URL pattern of theFacesServlet. You’ve mapped it on/faces/*, so the URL should contain the/facespath prefix right after the context path.Better would be to map the
FacesServletdirectly on*.xhtmlso that you never need to fiddle with virtual URLs.