SSM-----springMVC No mapping found for HTTP request with URI的问题
2017-11-12 17:03
477 查看
No mapping found for HTTP request with URI
出现这个问题的原因是在web.xml中配置错了,如:
当你在control中返回一个路径的时候,它又把路径(/view/index.jsp)当作一个请求被dispatcherServlet所拦截。所以会抛出异常。
出现这个问题的原因是在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/>
相关文章推荐
- 本人小白一枚,刚学习SpringMVC+MyBatis,遇到了一个问题一直报错 **No mapping found for HTTP request with URI**
- No mapping found for HTTP request with URI [/springmvc/queryitems.action] in DispatcherServlet with
- spring mvc No mapping found for HTTP request with URI
- springmvc No mapping found for HTTP request with URI in Dispatc
- springMVC No mapping found for HTTP request with URI
- springmvc No mapping found for HTTP request with URI in Dispatc
- springMVC No mapping found for HTTP request with URI
- springMVC No mapping found for HTTP request with URI
- springMVC报WARNING: No mapping found for HTTP request with URI [/springMVC/hello] in DispatcherServle
- spring mvc No mapping found for HTTP request with URI [] in DispatcherServlet
- Spring MVC PageNotFound.noHandlerFound No mapping found for HTTP request with URI
- Spring mvc No mapping found for HTTP request with URI
- java springmvc No mapping found for HTTP request with URI
- 【Spring】Spring3中js/css/jpg/gif等静态资源无法找到(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
- [org.springframework.web.servlet.PageNotFound] - No mapping found for HTTP request with URI [/ssm/us
- springmvc No mapping found for HTTP request with URI in Dispatc
- springmvc No mapping found for HTTP request with URI 可能原因统计
- Spring 3 MVC No mapping found for HTTP request with URI (转)