在web.xml中的配置:
<context-param>
<param-name>name1</param-name>
<param-value>value1</param-value>
</context-param>
在java中读取
String value = request.getSession().getServletContext().getInitParameter("name1");
在web.xml中的配置:
<context-param>
<param-name>name1</param-name>
<param-value>value1</param-value>
</context-param>
在java中读取
String value = request.getSession().getServletContext().getInitParameter("name1");