I'm doing a simple search engine for my web app and I'm facing a problem.
My search.xhtml
works by getting a parameter, so that search.xhtml?key=lol
will return the results for "lol".
What I need to do is that my search commandButton will redirect do search.xhtml?key=INPUT TEXT CONTENT
.
Here's my simple code :
<div id="searchBox">
<pou:panel id="searchPanel">
<h:form>
<h:inputText id="searchInput" value="#{dispensaRicercaBean.query}" size="99" maxlength="99"/> <pou:commandButton icon="ui-icon-search" action="ricerca?faces-redirect=true"/>
<pou:watermark value="Search" for="searchInput"/>
</h:form>
</pou:panel>
</div>
where dispensaRicercaBean
is @RequestScoped
and my result page loads the data calling executeQuery(#{request.getParameter('key'))
(a rough example, actually there are some differences)
How can I do that?