When you use JSF, you will have the javax.faces.webapp.FacesServlet controller servlet, which will display as follows:
<servlet-mapping>
...
<url-pattern>/somefacesurl/*</url-pattern>
</servlet-mapping>
Put mypage.xhtml in /, we have a security risk, because it will be available in two ways (starting from the application context): 1) /somefacesurl/mypage.xhtml
2)/mypages.xhtml
The first is processed by jsf and is correct.
The second is not processed by jsf and therefore is presented to the client by exposing jsf tags, and this is a security risk.
I found only two solutions
1) mapping always to the root URL:
<servlet-mapping>
...
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
A good solution, but only allows matching with the file extension.
2) URL- , , :
.xhtml JSF?
JSF 2.0 , .
, , "" xhtml , , .xhtml.