各位大神,我是用Struts 2做一个项目,现在,要做一个安全退出的功能,但是,我一直没法实现。
我是想让用户点击浏览器的后退键失去效果,但是,一直做不到。所以,跪求各位大神帮忙。
我查过,很多人都说用response去清空缓存,但是,一直没有。
现在,跪求各位大神帮忙啊。我的函数代码如下:
 public String Outtoindex()
    {
     HttpServletResponse response = ServletActionContext.getResponse();
     response.setHeader("Cache-Control","no-cache"); //Forces caches to obtain a new copy of the page from the origin server
     response.setHeader("Cache-Control","no-store");//Directs caches not to store the page under any circumstance
     response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
     response.setHeader("Pragma","no-cache");
     return "index";
    }