viewExpiredException JSF
为了处理JSF中的viewExpiredException,我进行了编码
javax.faces.application.ViewExpiredException /error.html 1
在web.xml
。
在error.html
我已重定向到原始登录页面。 但问题是会话范围的bean即使会话过期也没有被清除。 有什么方法可以解决这个问题吗?
可能已从浏览器缓存请求登录页面。 通过创建一个与FacesServlet
绑定的Filter
来禁用它,并且在doFilter()
方法中基本上有以下几行,这样就不需要在所有要阻止缓存的页面上重复它。
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. response.setHeader("Pragma", "no-cache"); // HTTP 1.0. response.setDateHeader("Expires", 0); // Proxies.