<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
</head>
<body>
<%! int count=0;
synchronized void setCount(){
count++;
}
%>
<% setCount();
out.print("你是第"+count+"个访问本站的用户");
%>

</body>
</html>

posted on 2019-04-04 09:13  行所当行  阅读(334)  评论(0编辑  收藏  举报