The 5.context-param element is used to set the environment parameter (context) of the Web site, which contains two child elements: Param-name and Param-value.
<param-name> parameter name </param-name> Set context Name
<param-value> value </param-value> Setting the value of the context name
Example:
<context-param>
<param-name>param_name</param-name>
<param-value>param_value</param-value>
</context-param>
The parameters that are set in the JSP Web page can be obtained by using the following methods: ${initparam.param_name}
The following methods can be used in the servlet to obtain: String Param_name=getservletcontext (). Getinitparamter ("Param_name");
<!--context-param element is used to set the environment parameter (context) of the Web site, which contains two child elements: Param-name and param-value., such as spring's typical configuration-->
<context-param>
<!--Set the context name-->
<param-name>contextConfigLocation</param-name>
<!--set the value of the context name-->
<param-value>/WEB-INF/spring-config.xml</param-value>
</context-param>
<!--Note: This set of parameters, in the JSP Web page can be obtained using the following methods: ${initparam.param_name}
The following methods can be used in the servlet to obtain: String Param_name=getservletcontext (). Getinitparamter ("Param_name"); -->
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/