springMVC No mapping found for HTTP request with URI
2014-09-24 11:02
513 查看
转载自:http://blog.sina.com.cn/s/blog_534f69a00101332u.html
1.问题:
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>
2.分析:
当你在control中返回一个路径的时候,它又把路径(/view/index.jsp)当作一个请求被dispatcherServlet所拦截。所以会抛出异常,解决的办法有两个:
3.解决:
第一即使让dispatcherServlet的拦截加上后缀如:*.do;
这样以jsp后缀的就不会别拦截了。
第二个方法是在spring-servlet.xml中加入:
<mvc:default-servlet-handler/>
1.问题:
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>
2.分析:
当你在control中返回一个路径的时候,它又把路径(/view/index.jsp)当作一个请求被dispatcherServlet所拦截。所以会抛出异常,解决的办法有两个:
3.解决:
第一即使让dispatcherServlet的拦截加上后缀如:*.do;
这样以jsp后缀的就不会别拦截了。
第二个方法是在spring-servlet.xml中加入:
<mvc:default-servlet-handler/>
相关文章推荐
- springmvc No mapping found for HTTP request with URI in Dispatc
- springMVC No mapping found for HTTP request with URI
- Spring MVC No mapping found for HTTP request with URI
- Spring MVC PageNotFound.noHandlerFound No mapping found for HTTP request with URI
- 本人小白一枚,刚学习SpringMVC+MyBatis,遇到了一个问题一直报错 **No mapping found for HTTP request with URI**
- springmvc No mapping found for HTTP request with URI in Dispatc
- spring mvc No mapping found for HTTP request with URI
- Spring mvc No mapping found for HTTP request with URI
- springmvc No mapping found for HTTP request with URI in Dispatc
- No mapping found for HTTP request with URI [/springmvc/queryitems.action] in DispatcherServlet with
- spring mvc No mapping found for HTTP request with URI [] in DispatcherServlet
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法
- springMVC No mapping found for HTTP request with URI
- SSM-----springMVC No mapping found for HTTP request with URI的问题
- java springmvc No mapping found for HTTP request with URI
- springMVC No mapping found for HTTP request with URI
- spring mvc page not found no mapping found for http request with uri
- springMVC报WARNING: No mapping found for HTTP request with URI [/springMVC/hello] in DispatcherServle
- springmvc No mapping found for HTTP request with URI in Dispatc
- 解决spring mvc No mapping found for HTTP request with URI错误的三种方法