这里写了个超简单的网页计时器用来练手的
代码如下
<%--
Created by IntelliJ IDEA.
User: 14584
Date: 2022/3/8
Time: 14:51
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%
Integer count= (Integer) application.getAttribute("count");
if(count!=null){
count=count+1;
}else{
count=1;
}
application.setAttribute("count",count);
%>
<%
Integer i= (Integer) application.getAttribute("count");
out.print("统计访问量:目前有"+i+"个人访问过本网站");
%>
</body>
</html>