<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
spring会默认在WEB-INF目录下查找applicationContext.xml文件
如果有多个配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext-hibernate.xml
<!-- classpath:applicationContext-hibernate_jndi.xml-->
classpath:applicationContext-dao.xml
classpath:applicationContext-service.xml
classpath:spring/proxy/system.xml,
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
本文详细介绍了如何在 Spring MVC 中使用 ContextLoaderListener 进行配置,并解释了如何指定多个配置文件的位置。通过 contextConfigLocation 参数可以加载多个 XML 文件。
9672

被折叠的 条评论
为什么被折叠?



