1.一次会话算一次访问。
<%! int i = 0;%>
<%
if(session.isNew()){
i ;
}
%>
<p>访问方式:一次会话算一次访问。 当前浏览量:<%=i %></p>
2.刷新一次网页增加一次浏览量:
<%
Integer count=(Integer)application.getAttribute("count");
if(count==null){
count=1;
}
application.setAttribute("count", count 1);
%>
<p>访问方式:刷新一次网页算一次访问。 当前浏览量:<%=count %></p>
更多专业前端知识,请上 【猿2048】www.mk2048.com