1.Error Information
Console Error Information: 严重: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/----------> Parent Classloader:org.apache.catalina.loader.StandardClassLoader@c2ff5 org.springframework.web.servlet.DispatcherServletjava.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
Http Error Information:
javax.servlet.ServletException: Wrapper cannot find servlet class org.springframework.web.servlet.DispatcherServlet or a class it depends on...java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet...
2.Analysis & Solution
之前jar包我是通过Build path -> Configure build path-> Add External JARs的方式添加的,程序编译,Tomcat启动都很正常,没有错误。可是一访问jsp页面就报上述错误。
苦思不得其解,但看了错误信息说是找不到org.springframework.web.servlet.DispatcherServlet类,所以我就干脆将spring.jar,spring-webmvc.jar等jar包通通手工添加到/WEB-INF/lib目录下,并且将default output folder值改为projectName/WebContent/WEB-INF/classes
问题就得以解决了。