<context-param> Initialization parameters for the entire 0 or more application
Context parameters are mechanisms used for setting application-initialization parameters. For example, you could set the URL to a database here. The following example enables the administrator to change the title and greeting of the example application: <context-param> <param-name>title</param-name> <param-value>Wrox example application – Chapter 6</param-value> </context-param> <context-param> <param-name>greeting</param-name> <param-value>Welcome to the example application</param-value> </context-param> There may be any number of context parameters in the application, known as initial parameters. Each dynamic resource (such as a Servlet, a JSP page, or a class) with access to the application context is able to look up the value associated with a given parameter name. Typical items provided as a context parameter are the debug status of the application, the verbosity of logging (these two are often interlinked), and as much other externalized configuration as the application developer has allowed.
ms很多时候也可以不定义这个context,然后带的这个<context-param>定义的两个xml文件传给谁了?
什么时候什么地方可以用?
application
you could set the URL to a database here. The following example enables the administrator to change
the title and greeting of the example application:
<context-param>
<param-name>title</param-name>
<param-value>Wrox example application – Chapter 6</param-value>
</context-param>
<context-param>
<param-name>greeting</param-name>
<param-value>Welcome to the example application</param-value>
</context-param>
There may be any number of context parameters in the application, known as initial parameters. Each
dynamic resource (such as a Servlet, a JSP page, or a class) with access to the application context is able
to look up the value associated with a given parameter name. Typical items provided as a context
parameter are the debug status of the application, the verbosity of logging (these two are often interlinked),
and as much other externalized configuration as the application developer has allowed.