Spring MVC 使用问题与解决--HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

1.HTTP Status 500 - Servlet.init() for servlet springmvc threw exception

Spring MVC 使用问题与解决--HTTP Status 500 - Servlet.init() for servlet springmvc threw exception_第1张图片
解决
使用jre1.7 Spring4.3

2.springMVC无法访问JSP报404,但是又能访问controller

第一种原因:

mvc
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
classpath*:/mvc.xml

1

 
     mvc
     /*
 

将url-pattern中/*改为/
配置对所有请求进行了拦截,controller对视图进行分发的时候又拦截。

第二种原因:

当时把jsp文件放到WEB-INF中了,但tomcat默认访问网页的目录是WEB-INF的父目录,正确的目录应该类似以下:

3.

a.No mapping found for HTTP request with URI [/sam_170309Web/user/register.action] in DispatcherServlet with name 'DispatcherServlet'
b.No Spring WebApplicationInitializer types detected on classpath

解决

检查控制器中的@Controller以及mvcContext.xml中的Action注册:

你可能感兴趣的:(Spring MVC 使用问题与解决--HTTP Status 500 - Servlet.init() for servlet springmvc threw exception)