<%@page language="java"
        contentType="text/html;charset=gb2312"
  import="java.util.*"
%>
<HTML>
<HEAD>
<TITLE> Application对象方法实例</TITLE>
</HEAD>
<BODY>
<%
String username="jspbook";
String password="123";
 //设置用户和密码属性
application.setAttribute("username",username);
application.setAttribute("password",password);
 //读取application的所有属性
Enumeration enum=application.getAttributeNames();
//显示所有内容
while(enum.hasMoreElements()){
 String attrName=(String)enum.nextElement();
 out.println(attrName+"----"+application.getAttribute(attrName)+"<BR>");
}
 
%>
</BODY>
</HTML>
