标签:
ServletContext application = this.getServletContext();
Integer count = (Integer)application.getAttribute("count");
if(count == null) {
count = 1;
} else {
count++;
}
response.setContentType("text/html;charset=utf-8");
response.getWriter().print("<h1>本页面一共被访问" + count + "次!</h1>");
application.setAttribute("count", count);
标签:
原文地址:http://www.cnblogs.com/ab10/p/4875630.html