index.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$网页计数器$</title>
</head>
<BODY >
<h1>
网页计数器
</h1>
<hr>
<%!
int count =0;
synchronized void increase(){
count++;
}
%>
<%
increase();
%>
<h1>你是网站第<%=count%>位访问者</h1>
</BODY>
</html>