tomcat启动时会加载web.xml
加载<listener> 和<context-param>属性
org.springframework.web.context.ContextLoaderListener.项目启动,会找这个监听器去查contextConfigLocation
配置一下这个监听器就好了
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>