web.xml里的contextConfigLocation参数定义了要装入的 Spring 配置文件。
xml代码类似如下:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/applicationContext*.xml
</param-value>
</context-param>
这里是给ContextLoaderListener指定要加载的xml,会去加载相应的xml,
容器对于web.xml的加载过程是context-param >> listener >> fileter >> servlet。