发帖求助链接http://bbs.csdn.net/topics/392190768
注意事项:
1.<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 一行中不能加后缀.class,应写DispatcherServlet的全限定名。否则tomcat报错500,如链接开头所示。
错误代码:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet.class</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
</servlet>
正确代码:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
</servlet>
2.虽然已经导入spring-webmvc包,在url正确的情况下仍报错404,根据http://blog.csdn.net/qq931399960/article/details/45119953的解决方案,还应导入commons-logging.jar包
另附上述链接中的知识点:
sprigMVC依赖包:
commons-logging.jar
spring-aop.jar
spring-beans.jar
spring-context.jar
spring-core.jar
spring-expression.jar
spring-web.xml
spring-webmvc.jar