HttpServletResponse设置http控制浏览器禁止缓存当前文档内容
HttpServletResponse设置http响应头控制浏览器禁止缓存当前文档内容,设置代码如下:
protected void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { response.setDateHeader("expries", -1); response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); }
版权声明:本文为JAVASCHOOL原创文章,未经本站允许不得转载。