如何在servlet中记录用户访问次数
ServletContext context = getServletContext();
Integer count = null;
count = context.getAttribute("count");
if(count==null){
count = new Integer(1);
}else{
count++;
}
context.setAttribute("count",count);
上面代码写在service(HttpServletRequest request,HttpServletResponse response);这个方法里面
不明白的话我可以把整个代码写出来