springMVC No mapping found for HTTP request with URI
转载自: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/>
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 in Dispatc 博客分类: Java Web springmvcspring MVCNo ...
- 【错误信息】springMVC No mapping found for HTTP request with URI
出现这个问题的原因是在web.xml中配置错了:
- 相对路径获取项目文件 及报错 No mapping found for HTTP request with URI XXX in DispatcherServlet with name ‘springmvc’解决方法
首先一点,WebRoot目录下的文件是都可以通过浏览器输入路径,直接读取到的 例如这样: 而WebRoot下面WEB-INF是无法浏览器输入路径直接读取的. 因为是受保护的. 如果jsp读取一个图片的 ...
- No mapping found for HTTP request with URI [/crmcrmcrm/css/bootstrap.min.css] in DispatcherServlet with name 'springMvc'
先把错误贴上来 No mapping found for HTTP request with URI [/crmcrmcrm/css/sb-admin-2.css] in DispatcherServ ...
- Servlet3模块化应用中,@Controller没有被注入,导致出现:No mapping found for HTTP request with URI [/xxx/xxx] in DispatcherServlet with name 'springmvc'
问题描述:Servlet3模块化应用中,@Controller没有被注入,导致出现: org.springframework.web.servlet.DispatcherServlet noHandl ...
- No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with name 'SpringMVC'
控制台一直报No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with na ...
- '/'和‘/*’差异造成的No mapping found for HTTP request with URI [/springMVC/welcome.jsp] in DispatcherServlet with name 'springmvc'
在采用springMVC框架的时候所遇到的一个小问题,其中web.xml中关于servlet的配置如下: <servlet> <servlet-name>springmvc&l ...
- SpringMvc出现No mapping found for HTTP request with URI的终极解决办法
No mapping found for HTTP request with URI 出现这个问题的原因是在web.xml中配置错了,如: <servlet> <servlet-na ...
- springmvc搭建环境时报No mapping found for HTTP request with URI [/exam3/welcome] in DispatcherServlet with name 'spring2'
项目是使用spring MVC (1)在浏览器中访问,后台总报错: No mapping found for HTTP request with URI [/exam3/welcome] in Dis ...
随机推荐
- WPF 内部的5个窗口之 MediaContextNotificationWindow
原文:WPF 内部的5个窗口之 MediaContextNotificationWindow 本文告诉大家在 WPF 内部的5个窗口的 MediaContextNotificationWindow 是 ...
- Python+Appium来写app自动化脚本
1...........................我有空再补
- ASP.NET-让html代码输出为字符串
HttpUtility.HtmlEncode这个函数可以让s变成没有攻击的代码,可以提升网站的安全性 public string Index(string s = "suepr name i ...
- EEPlat PaaS中的多租户数据隔离模式
EEPlat PaaS支持三种租户的数据隔离技术:Sparce Column.tenantId字段隔离.每一个租户独立数据库. 1)Sparce Column,和Salesforce Appforce ...
- [MST] Loading Data from the Server using lifecycle hook
Let's stop hardcoding our initial state and fetch it from the server instead. In this lesson you wil ...
- BZOJ 1088 水模拟
BZOJ水一道~ 枚举前两个位置是否放雷,模拟向下推.能够则ans++ #include "stdio.h" #include "string.h" int a ...
- poj--1703--Find them, Catch them(并查集巧用)
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64 ...
- WebAPI的自动化监控和预警
Metrics.net + influxdb + grafana 构建WebAPI的自动化监控和预警 前言 这次主要分享通过Metrics.net + influxdb + grafana 构建Web ...
- laravel中的数据迁移和数据填充
laravel中的数据迁移和数据填充 标签(空格分隔): php 生成迁移文件两种方式: 1 新建一个表的迁移文件 php artisan make:migration create_students ...
- [学习笔记]BS架构与CS架构
整理自:http://www.iteye.com/problems/102411 前两天面试的时候被问到这个问题,没有回答上来因此在这里学习整理一下. B/S架构 B/S架构的全称为Browser/S ...