visit.jsp 840 B

1234567891011121314151617181920212223242526272829303132
  1. <%@ page contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <% response.setContentType("text/html");
  4. response.setHeader("Pragma","No-cache");
  5. response.setHeader("Cache-Control","no-cache");
  6. response.setDateHeader("Expiress",0); %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <title>java计数器</title>
  11. </head>
  12. <body>
  13. <%
  14. if(application.getAttribute("count")==null){
  15. application.setAttribute("count", new Integer(0));
  16. }
  17. Integer count=(Integer)application.getAttribute("count");
  18. application.setAttribute("count", new Integer(count.intValue()+1));
  19. count=(Integer)application.getAttribute("count");
  20. %><div id="aaa"> 这是第
  21. <%=count.intValue()%>个访问量
  22. </div>
  23. </body>
  24. </html>