I am trying to navigate to an administration page which has a sub directory under the webcontent folder and receiving an java.io.FileNotFoundException. Using Glassfish 3.1.1.
My
war File:
index.xhtml
login.xhtml
/admin/admin.xhtml
the link i am using is:
<h:link value="Admin" outcome="admin/admin.xhtml"/>
I was hoping implicit naviagtion would be able to handle this?
Thanks in advance,
Scott
Your
<h:link>looks perfectly fine, although I would just trim off the.xhtmlextension to minimize boilerplate and FacesServlet mapping ambiguity which JSF already takes care of for you.You need to read the message of the
FileNotFoundExceptionwhich you got there. My cents on that it actually points to the template file which you’re using in<ui:composition template>ofadmin/admin.xhtml. You’d like to specify an absolute path in there, i.e. starting with/, so that it’s resolved relative to the root of the web content, otherwise it’s resolved relative to the location of the current template client.E.g. thus not so:
which would search for
/admin/WEB-INF/admintemplate.xhtml, but rather so:Note that this is not related to implicit navigation. You would have exactly the same problem when opening the page directly.