I\'m having some trouble with navigation when using Facelets.
I have my master template in /WEB-INF
:
This means that the request URL (as appears in browser address bar) didn't match the URL pattern of the FacesServlet
as definied in web.xml
.
Those links
<a href="ram.xhtml">RAM</a>
<a href="mobo.xhtml">Motherboard</a>
<a href="video.xhtml">Video Card</a>
expects the FacesServlet
to be mapped on *.xhtml
. But if it's mapped on for example *.jsf
and changing it to *.xhtml
is not an option for some reason (I however strongly recommend it), then you'd need to fix the links
<a href="ram.jsf">RAM</a>
<a href="mobo.jsf">Motherboard</a>
<a href="video.jsf">Video Card</a>
Or, better, just use <h:link>
. It'll implicitly append the proper context path and FacesServlet
mapping:
<h:link value="RAM" outcome="ram" />
<h:link value="Motherboard" outcome="mobo" />
<h:link value="Video Card" outcome="video" />