按下后退按钮显示"此文档不再可用"而不是新请求的页面

时间:2014-08-13 13:07:20

标签: jsf back-button jsf-2.2

我正在努力解决上面提到的问题我正在使用代码来清除浏览器的缓存

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException 
{
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;

    if (!req.getRequestURI().startsWith(req.getContextPath() + ResourceHandler.RESOURCE_IDENTIFIER)) { 
        res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); 
        res.setHeader("Pragma", "no-cache"); 
        res.setDateHeader("Expires", 0); 
    }
    chain.doFilter(request, response);
}

我已登录应用程序并点击后退按钮,它直接给我发消息 “这份文件已不再可用。”请建议我

0 个答案:

没有答案