在web.xml中应用监听器初始化spring容器

在web.xml中使用监听器初始化spring容器
<!-- 采用Listener完成Spring容器的初始化 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>