核心代码:
application.jsp
<body>
<!-- 显示账号信息 -->
<%
String Name = (String)application.getAttribute("user");
String Password = (String)application.getAttribute("pass");
out.println("用户名:"+Name);
out.println("密码:"+Password);
%>
<br>
<!--站点计数器 -->
<%
String strNum = (String)application.getAttribute("num");
int num=0;
if(strNum != null)
num = Integer.parseInt(strNum)+1;
application.setAttribute("num", String.valueOf(num));
%>
访问次数为:<%=num %>
<%
out.println("5秒后,自动跳转到cookie计数器界面");
response.setHeader("Refresh", "5,URL=cookie.jsp");
%>
</body>