打开视图的4个标签后,我不断收到 javax.faces.application.ViewExpiredException 。每个选项卡都使用@ViewScoped并拥有自己的Managed bean。我已经尝试过在网上看到的修复程序,比如为每个Managed bean实现Serializable,增加会话超时和
将其放在web.xml中
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>15</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.serializeServerState</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
<param-value>15</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION/param-name>
<param-value>false</param-value>
</context-param>
我使用的每个页面都与此相同,并使用不同的支持bean:
<h:form>
<p:poll interval="1" listener="#{someBean.refresh}" update="table"
global="false" />
<p:dataTable id="table" value="#{someBean.list}" var="e"
rowIndexVar="rowIndex">
<p:column headerText="" style="width: 10%">
<h:outputText value="#{rowIndex}" />
</p:column>
<p:column headerText="Description" style="width: 90%">
<h:outputText value="#{e.description}" />
</p:column>
</p:dataTable>
</h:form>