网站访问量统计案例

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+""+"次");

原文地址:https://www.cnblogs.com/danyuzhu11/p/6653087.html