统计网站访问人数示例

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>
  <head>   <title>统计网站访问人数页面</title>  </head>
  
  <body>
   <%!Integer yourNumber=new Integer(0); %>
   <%if(session.isNew()){
        Integer number=(Integer)application.getAttribute("Count");
        if(number==null)
        {number=new Integer(1);}
        else
        {number=new Integer(number.intValue()+1);}
        application.setAttribute("Count",number);
        yourNumber=(Integer)application.getAttribute("Count");
   }
    %>
    欢迎访问本站,您是第<%=yourNumber %>个访问用户!
  </body>
</html>

  

时间最会骗人,但也能让你明白,这个世界上没有什么是不能失去的,留下的尽力珍惜,得不到的都不重要
原文地址:https://www.cnblogs.com/www-x/p/7787246.html