web listener 配置的问题



一个关于web.xml中添加springListener"严重"的问题,

程序错误信息为:
2011-08-18 10:31:22 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2011-08-18 10:31:22 org.apache.catalina.core.StandardContext start
严重: Context [/Salvation] startup failed due to previous errors

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>



这个在tomcat5.x中启动时候会有警告,项目无法访问.而在tomcat.6.x中,就没问题.

解决方法为:

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

改成:
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


你可能感兴趣的:(Web,springlistener)