ServletContext application=this.getServletContext();
Integer count=(Integer) application.getAttribute("count"); if(count==null){ application.setAttribute("count", 1); }else{ application.setAttribute("count", count+1); } response.setContentType("text/html;charset=utf-8");//像浏览器输出 response.getWriter().write("该页面工访问"+count+""+"次");