I need to navigate from one page to another on button click. It works if I do it like this
<h:commandButton value="Search" action="pageTwo.xhtml" />
but I need to do other things and not just navigate. When I try to use a function
<h:commandButton value="Search" actionListener="#{myLittleBean.doForward}" />
public String doForward() {
// ...
return "pageTwo";
}
it just reloads the pageOne. Where is my mistake?