web统计页面的访问量

在登陆的控制页面添加以下代码
<%
….//省略页面的代码
Integer count=(Integer)application.getAttribute(“count”);
if(count != null){
count=count+1
}else{
count=1
}
application.setAttribute(“count”,count);
%>
统计页面增加的代码如下
<%
Integer i= (Integer ) application.getAttribute(“count”);
out.print(“目前有”+i+”个人访问过本网站”);
%>

猜你喜欢

转载自blog.csdn.net/qq_42904898/article/details/81545184