我有一个webapp,我从另一个使用spring的团队继承而来。我一直在试图调试一些奇怪的行为,并想“关闭”任何spring servlet/filters/context-listeners。即使web.xml不包含它,Spring的ContextLoaderListener如何运行?
所以我莫名其妙后干净的去除在web.xml是这个样子...项
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
然而/构建和我们的应用程序我打org.springframework.web.context的运行。方法contextInitialized上的ContextLoaderListener。
所以我的问题是如果我的web.xml不再声明ContextLoadListener作为侦听器来运行它/为什么它正在运行?我看,Spring 3.2.3-RELEASE的源代码似乎没有Servlet 3.0 Annotation @WebServletContextListener。
那么为什么/如何运行这个Context Listener?
你的类路径中是否有任何'WebApplicationInitializer'类? –
检查调度程序servlet是否正在加载任何配置。 – 11thdimension
是org.glassfish.jersey.server.spring.SpringWebApplicationInitializer。其实两个版本是2.5.1,另一个是2.22.1。 – benstpierre