javax.faces.application.ViewExpiredException:无法还原视图我用容器管理的安全性编写了简单的应用程序。问题是,当我登录并打开另一个页面,然后我回到第一页,我点击任何链接等或刷新页面,我得到这个异常。我想这是正常的(或者不是:),因为我注销了,会话被销毁了。我应该如何将用户重定向到例如index.xhtml或login.xhtml,并避免他看到错误页面/消息?换句话说,如何在注销后自动将其他页面重定向到索引/登录页?下面是:javax.faces.application.ViewExpiredException: viewId:/index.xhtml - View /index.xhtml could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at filter.HttpHttpsFilter.doFilter(HttpHttpsFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
4 回答
红糖糍粑
TA贡献1815条经验 获得超6个赞
web.xml
?
<context-param> <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name> <param-value>true</param-value></context-param>
翻阅古今
TA贡献1780条经验 获得超5个赞
implements Serializable
:
@ManagedBean@ViewScopedpublic class Login implements Serializable {}
噜噜哒
TA贡献1784条经验 获得超7个赞
避免RichFaces中的多部分形式:
<h:form enctype="multipart/form-data"> <a4j:poll id="poll" interval="10000"/></h:form>
如何调试:
添加回答
举报
0/150
提交
取消