I have a small JSF (latest) application. This kind of navigation works fine
<p:commandButton value="New user" action="#{loginView.createUser()}"/>
with
public String createUser() {
return "newUser" + SessionUtils.REDIRECT_URL_SUFFIX;
}
However, when trying the following method, it gives me a 404 error:
<p:commandButton value="New user" action="#{loginView.createUser()}"/>
with
public void createUser() {
FacesContext.getCurrentInstance().getExternalContext().redirect("newUser.xhtml" + SessionUtils.REDIRECT_URL_SUFFIX);
}
Any suggestions?
I should add that the above method only works when navigating from the first page to the second. It stops working after that... The first one works fine on any page.