I found lots of similar questions, but none of the solutions worked for me.
I have this inputText field in which the user types a text, and this text is saved in my bean:
<h:inputText value="#{searchBean.param}"/>
Then there's this button that when clicked, executes a search algorithm and then redirects the user to the results page, like this:
<h:commandButton value="Botao" action="#{searchBean.execute}"/>
The execute method:
public String execute() {
levenshtein(this.param);
return "results";
}
This will forward the user to ..../results.xhtml, and i need this link to be like this:
.../results.xhtml?equation="whatever the user intended to search"&pagenumber="current page number"
When I click on a link in this page, I'm redirected outside my site, say to wikipedia, and then when I click the back button on my browser, I need to be able to recover what the I searched for and the page I was.
I spent quite some time trying to find out how to do this and every attempt failed, please help me, thank you.