<%
...
@pagecontentType="text/html;charset=GBK"isELIgnored="false"
%>
<% ...
if(application.getAttribute("count")==null){
application.setAttribute("count",newInteger(0));
}
Integercount=(Integer)application.getAttribute("count");
application.setAttribute("count",newInteger(count.intValue()+1));
%>
< html >
< head >
< title > 页面被访问数统计 </ title >
< meta http-equiv ="Content-Type" content ="text/html;charset=GBK" />
</ head >
< body bgcolor ="#ffffff" >
< form action ="RequestJsp.jsp" >
< p ></ p >
< p ></ p >
< h1 >
< input type ="submit" name ="sub" value ="点击!" />
</ h1 >
<!-- 输出访问次数 -->
< h1 > 此页面已被访问了${applicationScope.count}次
</ h1 >
</ form >
</ body >
</ html >
<% ...
if(application.getAttribute("count")==null){
application.setAttribute("count",newInteger(0));
}
Integercount=(Integer)application.getAttribute("count");
application.setAttribute("count",newInteger(count.intValue()+1));
%>
< html >
< head >
< title > 页面被访问数统计 </ title >
< meta http-equiv ="Content-Type" content ="text/html;charset=GBK" />
</ head >
< body bgcolor ="#ffffff" >
< form action ="RequestJsp.jsp" >
< p ></ p >
< p ></ p >
< h1 >
< input type ="submit" name ="sub" value ="点击!" />
</ h1 >
<!-- 输出访问次数 -->
< h1 > 此页面已被访问了${applicationScope.count}次
</ h1 >
</ form >
</ body >
</ html >