I've the following xhtml page, that is wrapped in the major part of the other pages in my project:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title></title>
</h:head>
<h:form>
<p:menubar>
<p:menuitem value="Home" url="/protected/personal/HomeCalendar.xhtml" icon="ui-icon-home"/>
<p:menuitem value="#{topbarBean.username}" url="#" style="text-decoration: underline" />
<f:facet name="options">
<p:inputText style="margin-right:20px" placeholder="Search" value="#{searchBean.searched}"/>
<p:commandButton action="#{searchBean.search()}" type="submit" icon="ui-icon-search" />
</f:facet>
</p:menubar>
</h:form>
</ui:composition>
This is the navigation rule that I've wrote:
<navigation-rule>
<from-view-id>/Components/TopBar.xhtml</from-view-id>
<navigation-case>
<from-action>#{searchBean.search()}</from-action>
<from-outcome>searchingResults</from-outcome>
<to-view-id>/protected/SearchResults.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
and this the referred Bean:
@RequestScoped
@ManagedBean
public class SearchBean implements Serializable {
private String searched;
private final String resultsOutcome = "searchingResults";
private List<User> users;
private List<Event> events;
@EJB
UserFacade uf;
@EJB
UserManager um;
@EJB
EventFacade ev;
@PostConstruct
public void init(){
try {
setEvents(um.getEventsVisibilityMasked(um.getLoggedUser().getId()));
}
catch (NotFoundException ex) {
Logger.getLogger(SearchBean.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void setSearched(String searched) {
this.searched = searched;
}
public String getSearched() {
return searched;
}
public void search() {
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, resultsOutcome);
}
public List<User> getUsers(){
return users;
}
public void setUsers(List<User> users){
for(User user:users)
this.users.add(user);
}
public List<Event> getEvents(){
return events;
}
public void setEvents(List<Event> events){
for(Event event:events)
this.events.add(event);
}
}
The error is the following one: JSF1064: Unable to find or serve resource, /protected/personal/searchingResults.xhtml.
This path is not specified anywhere, if it could be helpful I've the following structure :
-Index,xhtml
-Web Pages { components , protected}
-components{TopBar.xhtml}
-protected {event,persona,user,SearchResults.xhtml}
-event{eventCreate,eventPage,eventEdit}
-personal{HomeCalendar,ManageSettings,ManageInvitations}
I don't understand if the problem regards the navigation-rule or the next xhtml page.