<%
//使用application是先网页的网站访问的次数
//1 要有一个变量计算页面的访问次数
//先把统计次数的变量拿出来
Object count = application.getAttribute("count");
if(count == null ){
//第一次访问 需要创建一个存储访问次数的变量 并将其放进application中
//第一次访问为空 所以给count赋值为1
application.setAttribute("count", 1);
}else{
//非第一次访问 去application中先将记路的次数拿出来 +1 将最新访问次数放进 applicat
Integer i = (Integer)count; //先拿出来之前的 变成整型
application.setAttribute("count", i+1);
}
//拿出最新的count复制给 icount
Integer icount = (Integer)application.getAttribute("count");
//打印
out.print("页面访问次数"+icount);
%>