When I request /personal/faces/public/login.xhtml
, then it works fine, but when I request /personal/public/login.xhtml
without /faces
I ob
This is happening because you've specified /faces/*
in your FacesServlet
configuration in the web.xml. As a result, any file requested that does not match the specified url pattern will be served as a regular file with a GET
request
Change that config to the following to ensure all JSF related requests go through the FacesServlet:
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
This ensures all files with .xhtml extension will be processed before returning to the client.
While the above solution may solve the immediate problem, what you're experiencing points to a deeper security issue. It indicates that anyone with a browser can request and download artifacts from your web application deployment and possibly other parts of your filesystem. This is a security hole you will need to look into. The options vary depending on your App server