web.xml中配置spring监听器和spring配置文件位置

<!-- spring配置文件位置 -->
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:applicationContext.xml</param-value>
 </context-param>
 <!-- spring核心监听器 -->
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>

原文地址:https://www.cnblogs.com/huqin/p/6937994.html