html>
<body>
<h2>Hello World! 000</h2>
<%
int count=0;
Object o=application.getAttribute("count");
if(o!=null)
{
count=(Integer)o;
}
count ++;
application.setAttribute("count",count);
%>
<%=count%>
</body>
</html>
效果图如下:
html>
<body>
<h2>Hello World! 000</h2>
<%
int count=0;
Object o=application.getAttribute("count");
if(o!=null)
{
count=(Integer)o;
}
count ++;
application.setAttribute("count",count);
%>
<%=count%>
</body>
</html>
效果图如下: