?? counter.jsp
字號(hào):
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%
Integer count = null;
//同步處理
synchronized (application)
{
//從內(nèi)存當(dāng)中讀取訪問(wèn)量
count = (Integer) application.getAttribute("basic.counter");
if (count == null)
count = new Integer(0);
count = new Integer(count.intValue() + 1);
//將訪問(wèn)量保存到內(nèi)存當(dāng)中
application.setAttribute("basic.counter", count);
}
%>
<html>
<head>
<title>簡(jiǎn)單計(jì)數(shù)器</title>
</head>
<body>
<center>
<font size=10 color=blue>簡(jiǎn)單計(jì)數(shù)器</font>
<br>
<hr>
<br>
<font size=5 color=blue>您好!您是本站的第 <%= count %> 位客人</font>
</center>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -