I\'ve the following xhtml page, that is wrapped in the major part of the other pages in my project:
That can happen if JSF can't find the matching navigation rule. It'll then switch to implicit navigation. I.e. the outcome will be used as the actual view ID, relative to the current context.
Apparently the current view ID is sitting somewhere in /protected/personal
. An outcome of searchingResults
which doesn't match any navigation rule will then trigger an implicit navigation to /protected/personal/searchingResults.xhtml
.
You've 2 options:
Fix the current view ID. The <from-view-id>/Components/TopBar.xhtml</from-view-id>
is apparently wrong. You can find out the right one as follows:
System.out.println(FacesContext.getCurrentInstance().getViewRoot().getViewId());
It's usually the one matching the context-relative URI in browser's address bar as long as you don't use POST for page-to-page navigation. Use this value in <from-view-id>
.
Get rid of navigation cases altogether and rely on implicit navigation. Remove the <navigation-case>
altogether from faces-config.xml
and change the outcome value and action method as below:
private final String resultsOutcome = "/protected/SearchResults.xhtml";
public String search() {
return resultsOutcome;
}
The NavigationHandler
approach was also quite clumsy. Even with navigation cases, just return the outcome outright instead of fiddling with NavigationHandler
.