web.xml
ctrl + shift + t搜索contextloadlistener,复制完整类名
配置listener,配置全局参数
<!-- 监听器:spring随web项目的启动而启动 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置spring配置文件的位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application.xml</param-value>
</context-param>