JSF will trim off own URL pattern from the request URL before finding the resource. You need to put /index.xhtml
file exactly there where JSF expects it as per the error message: in /index.xhtml
. So, outside the /web
folder. Note that you can just keep using /web
in request URL.
An alternative is to just map the FacesServlet
on *.xhtml
. This way you don't need to worry about virtual URLs.