一个简单的网站计数器方法:
----------------------------------------------------------------
<body>
  <%Integer count = (Integer)application.getAttribute("count");
  if(count==null){
  count=1;
  }else{
  count++;
  }
  application.setAttribute("count",count);
   %>
   <p>欢迎访问,您是第<%= count %>个访问者</p>
  </body>

---------------------------------------------------------------