<%@ page contentType="text/html;charset=gb2312" %> <% int number = 0; Integer num =(Integer)application.getAttribute("num"); if(num==null){ application.setAttribute("num",new Integer(number)); } else{ number = num.intValue()+1; application.setAttribute("num",new Integer(number)); } %> application example
application对象示例

本页面文件的实际路径是:
<%=application.getRealPath("application.jsp") %>
application对象中变量num的值为:<%=application.getAttribute("num") %>