【发布时间】:2012-05-17 05:56:10
【问题描述】:
我正在为我的网络应用做一个简单的搜索引擎,但我遇到了一个问题。
我的search.xhtml 通过获取参数来工作,因此search.xhtml?key=lol 将返回“lol”的结果。
我需要做的是我的搜索命令按钮将重定向做search.xhtml?key=INPUT TEXT CONTENT。
这是我的简单代码:
<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>
其中dispensaRicercaBean 是@RequestScoped,我的结果页面加载了调用executeQuery(#{request.getParameter('key')) 的数据(一个粗略的例子,实际上存在一些差异)
我该怎么做?
【问题讨论】:
标签: forms jsf redirect primefaces managed-bean