SSH整合过程中出现找不到org.springframework.web.context.ContextLoaderServlet的错误

来源:互联网 发布:mac口红吧 编辑:程序博客网 时间:2024/06/06 01:10
解决办法:

因在Spring3.0中去掉了ContextLoaderServlet和Log4jConfigServlet,所以会出现找不到类的异常错误。

Spring3.0下可以采用另外两种启动方式:ContextLoaderListener和ContextLoaderPlugIn。建议使用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>
0 0