JSF 视图过期异常
为了在 JSF 中处理 viewExpiredException,我
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/error.html</location>
</error-page>
<session-config>
<session-timeout>1</session-timeout>
</session-config>
在 web.xml
中进行了编码。
在 error.html
中,我已重定向到原始登录页面。但问题是,即使会话过期,会话范围的 bean 也没有被清除。有什么办法可以解决这个问题吗?
To handle viewExpiredException in JSF, I coded
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/error.html</location>
</error-page>
<session-config>
<session-timeout>1</session-timeout>
</session-config>
in web.xml
.
In error.html
I have redirected to original login page. But the problem is session scoped bean were not cleared out even session expired. Is there any way to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
登录页面可能是从浏览器缓存请求的。通过创建一个与
FacesServlet
绑定的Filter
来禁用它,并且在doFilter()
方法中基本上具有以下几行,这样您就不需要无需在您想要阻止缓存的所有页面上重复此操作。The login page is likely been requested from the browser cache. Disable it by creating a
Filter
which is tied to theFacesServlet
and has basically the following lines in thedoFilter()
method, so that you don't need to repeat it over all pages which you'd like to prevent from being cached.