J2EE 加载Spring的applicationContext.xml文件的两种方式
2009-08-07 10:17
603 查看
1、在web.xml中加载:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>**/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
2、在struts-config.xml中加载:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="**/applicationContext.xml" />
</plug-in>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>**/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
2、在struts-config.xml中加载:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="**/applicationContext.xml" />
</plug-in>
相关文章推荐
- 使用web.xml方式加载 Spring时,获取Spring context的两种方式:
- Spring加载properties文件的两种方式
- Spring加载properties文件的两种方式
- 使用web.xml方式加载Spring时,获取Spring context的两种方式
- Spring加载properties文件的两种方式
- Spring学习-03:ApplicationContext加载配置文件的两种方式
- Spring加载配置文件的两种方式
- spring加载配置文件的两种方式
- Spring中加载ApplicationContext.xml文件的方式
- spring 配置加载外部文件的两种方式
- Spring加载properties文件的两种方式
- Spring中加载ApplicationContext.xml文件的方式
- 在javaSE中使用Spring加载ApplicationContext.xml文件的方式
- Spring加载properties文件的两种方式
- Spring加载properties文件的两种方式
- JavaScript加载XML文件的两种方式
- Spring加载properties文件的两种方式
- 使用web.xml方式加载Spring时,获取Spring context的两种方式
- Spring加载properties文件的两种方式
- Spring加载properties文件的两种方式