<!-- 配置Spring的核心监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
web中加载的spring 配置文件就是靠ContextLoaderListener 才做到在项目启动的时候去加载application文件的
本文介绍了如何使用ContextLoaderListener在项目启动时加载Spring配置文件。通过配置web.xml中的监听器,可以实现application文件的自动加载。
1万+

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



