【发布时间】:2016-08-15 12:28:03
【问题描述】:
我有一个使用 a4j:commandButton 的 Web 应用程序,如下所示:
<h:form>
<a4j:region id="search_form">
<a4j:commandButton render="ListOfPerson" action="personBean.search" value="search" execute="@form" status="ajaxStatus"/>
</a4j:region>
<a4j:outputPanel id="ListOfPerson" ajaxRendered="true">
<rich:datatable>...</rich:datatable>
</a4j:outputPanel>
</form>
bean 使用@ManagedBean(faces package) 和@ViewScope 进行注释。当我将范围更改为@SessionScope 时,一切都按预期工作。有什么想法吗?
我正在使用以下导入:
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
【问题讨论】:
-
检查导入。它应该是 javax.faces.bean.ViewScoped (和注解 @ViewScoped 而不是 ViewScope)
-
我已经更新了帖子,已经在使用 faces.bean 中的@ViewScoped
标签: jsf-2 richfaces java-ee-6 ajax4jsf