java_web/webapp/application.jsp
2024-12-09 22:17:48 +08:00

22 lines
621 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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));
}
%>
<html><head><title>application example</title></head>
<body>
<center><font color="#0000ff" size="5">application对象示例</font>
</center>
<hr>
本页面文件的实际路径是:<br><%=application.getRealPath("application.jsp") %><br>
application对象中变量num的值为<%=application.getAttribute("num") %>
</body>
</html>