counter.jsp

来自「resinweb服务器源文件」· JSP 代码 · 共 27 行

JSP
27
字号
<%@ page %><%//// The counter is stored in the Application object.// Since Application is shared between different server// threads, it needs to be synchronized to properly update// the state.//Integer count = null;synchronized (application) {  count = (Integer) application.getAttribute("basic.counter");  if (count == null)    count = new Integer(0);  count = new Integer(count.intValue() + 1);  application.setAttribute("basic.counter", count);}%><html><head><title>Counter</title></head><body bgcolor=#ffffff><h1>Welcome, visitor: <%= count %></h1></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?