注:本文梳理启动流程使用的Spring版本:4.0.2.RELEASE 使用spring配置,都需要在web.xml中配置一个spring的监听器和启动参数(context-param),如下:
注:本文梳理启动流程使用的Spring版本:4.0.2.RELEASE
<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:spring-*.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
web容器启动时,下面为spring加载执行步骤:
web容器停止时候会执行ContextLoaderListener的contextDestroyed方法销毁context容器