Unable to find matching navigation case with from-view-id ‘/pages/index.xhtml’

You should not include the context path /ui nor the FacesServlet mapping /faces in the navigation case outcome. It should just represent the sole view ID, which is basically just the path to the physical view file absolute to the webcontent root or relative to the current view ID.

So, absolute (starting with /) to the webcontent root:

/pages/home.xhtml

Or relative (not starting with /) to the current view ID (assuming that you’re in /pages/index.xhtml):

home.xhtml

Do note that dot-slash ./ and double-dot-slash ../ notations are not supported.

Or even without file extension; JSF will imply the Facelets default suffix which defaults to .xhtml and is configureable by javax.faces.DEFAULT_SUFFIX context parameter:

/pages/home
home

It makes after all also sense if you realize that the context path /ui and the FacesServlet mapping /faces/* are not controllable from inside the webapp on! If they ever change externally, then you’d theoretically need to change all navigation case outcomes in the entire codebase and rebuild the webapp. This would not make any sense. JSF takes thus already care of them for you.

See also:

Leave a Comment