ServletContext对象:
<init-param>
<param-name>user</param-name>
<param-value>root</param-value>
</init-param>
<init-param>
<param-name>pass</param-name>
<param-value>1234</param-value>
</init-param>
1.获取指定名称的context配置信息
ServletContex context=this.getServletContext();
String user=context.getInitParameter("user");
System.out.println(user);
2.获取context里面的所有配置
Enumeration<String> enums=context.getInitParameterNames();
while(enums.hasMoreElements(){
String key=enums.nextElement();
String value=context.getInitParameter(key);
System.out.println(key +"========"+ value
}