springmvc 出现No mapping found for HTTP request with URI
2017-11-17 10:04
405 查看
No mapping found for HTTP request with URI
出现这个问题的原因是在web.xml中配置错了,如:
<servlet>
<servlet-name>springMVCDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springMVC-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVCDispatcherServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
当你在control中返回一个路径的时候,它又把路径(/view/index.jsp)当作一个请求被dispatcherServlet所拦截。所以会抛出异常,解决的办法有两个:
第一即使让dispatcherServlet的拦截加上后缀如:*.do;
这样以jsp后缀的就不会别拦截了。
第二个方法是在spring-servlet.xml中加入:
<mvc:default-servlet-handler/>
就解决了此问题
出现这个问题的原因是在web.xml中配置错了,如:
<servlet>
<servlet-name>springMVCDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springMVC-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVCDispatcherServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
当你在control中返回一个路径的时候,它又把路径(/view/index.jsp)当作一个请求被dispatcherServlet所拦截。所以会抛出异常,解决的办法有两个:
第一即使让dispatcherServlet的拦截加上后缀如:*.do;
这样以jsp后缀的就不会别拦截了。
第二个方法是在spring-servlet.xml中加入:
<mvc:default-servlet-handler/>
就解决了此问题
相关文章推荐
- idea部署SpringMVC项目出现No mapping found for HTTP request with URI [xxxxxxx] in DispatcherServlet ...错误
- SpringMvc4.2.5 零配置出现 No mapping found for HTTP request with URI
- No mapping found for HTTP request with URI [/index.html] in DispatcherServlet with name 'springmvc'
- springMVC之No mapping found for HTTP request with URI 问题
- 在写springmvc整合hibernate的时候报警告No mapping found for HTTP request with URI的原因
- springMVC--关于no mapping found for http request with uri .......
- No mapping found for HTTP request with URI [/SpringMvc2/ItemList] in DispatcherServlet with name 'sp
- SpringMVC:No mapping found for HTTP request with URI [/account/*] in DispatcherServlet with
- No mapping found for HTTP request with URI [/index.do] in DispatcherServlet with name 'SpringMVC‘
- springMVC报WARNING: No mapping found for HTTP request with URI [/springMVC/hello] in DispatcherServle
- SpringMVC资源无法找到(No mapping found for HTTP request with URI)问题解决
- mark springmvc [No mapping found for HTTP request with URI]
- springMVC--关于no mapping found for http request with uri
- Sprin mvc 出现 No mapping found for HTTP request with URI,解决方案之一
- 完美解决SpringMVC中静态资源无法找到(No mapping found for HTTP request with URI)问题
- SpringMVC中静态资源无法找到(No mapping found for HTTP request with URI)的四种解决方式
- springMVC 报404 No mapping found for HTTP request with URI [/ssmAngular/student/toIndex] in Dispatch
- SpringMVC - 问题. No mapping found for HTTP request with URI
- No mapping found for HTTP request with URI [/app17a/] in DispatcherServlet with name 'springmvc'解决方法
- No mapping found for HTTP request with URI [/chart/get] in DispatcherServlet with name 'SpringMVC‘