'/'和‘/*’差异造成的No mapping found for HTTP request with URI [/springMVC/welcome.jsp] in DispatcherServlet with name 'springmvc'
在采用springMVC框架的时候所遇到的一个小问题,其中web.xml中关于servlet的配置如下:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
重点是url-pattern 部分的配置,在配置为/*时,会报错WARNING: No mapping found for HTTP request with URI [/springMVC/welcome.jsp] in DispatcherServlet with name 'springmvc'
但是当将该部分配置为/时竟然运行ok了。
网上关于两者的解释如下:
一、<url-pattern>/</url-pattern>
:
会匹配到/springmvc这样的路径型url,不会匹配到模式为*.jsp这样的后缀型url。
二、<url-pattern>/*</url-pattern>
:
会匹配所有的url:路径型的和后缀型的url(包括/springmvc,.jsp,.js和*.html等)。
根据上述说明,按理说第二种配置应该包含第一种才对,可是,运行仍然没有出现结果,也就是说第一种能够运行,第二种一定能够运行,但是实际并没有如此,很是奇怪。
'/'和‘/*’差异造成的No mapping found for HTTP request with URI [/springMVC/welcome.jsp] in DispatcherServlet with name 'springmvc'的更多相关文章
- 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 [/jiaoyu/student/add] in DispatcherServlet with name 'SpringMVC'
项目是使用spring MVC (1)在浏览器中访问,后台总报错: No mapping found for HTTP request with URI [/exam3/welcome] in Dis ...
- No mapping found for HTTP request with URI [/user/login.do] in DispatcherServlet with name 'dispatcher'错误
1.警告的相关信息 七月 24, 2017 3:53:04 下午 org.springframework.web.servlet.DispatcherServlet noHandlerFound警告: ...
- spring mvc No mapping found for HTTP request with URI [/web/test.do] in DispatcherServlet with name 'spring'
原因: spring-servlet.xml 中 <context:component-scan base-package="com.test.controller" /&g ...
- 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 [/exam3/welcome] in DispatcherServlet with name 'spring2'
项目是使用spring MVC (1)在浏览器中访问,后台总报错: No mapping found for HTTP request with URI [/exam3/welcome] in Dis ...
- spring访问静态资源出错,No mapping found for HTTP request with URI xxx/resources/js/jquery.min.js...
问题:spring访问静态资源出错,No mapping found for HTTP request with URI xxx/resources/js/jquery.min.js... web.x ...
- SpringMvc出现No mapping found for HTTP request with URI的终极解决办法
No mapping found for HTTP request with URI 出现这个问题的原因是在web.xml中配置错了,如: <servlet> <servlet-na ...
- 问题 “No mapping found for HTTP request with URI [/rbiz4/uploadFile.html]” 的解决
从以前的SpringMVC项目简化一下做个例子,结果出现了下面的错误: No mapping found for HTTP request with URI [/rbiz4/uploadFile.ht ...
随机推荐
- http调用之RestTemplate
核心方法为org.springframework.web.client.RestTemplate.doExecute(URI, HttpMethod, RequestCallback, Respons ...
- ava StringTokenizer 类使用方法
菜鸟教程 -- 学的不仅是技术,更是梦想! 首页 笔记首页 Android 互联网 程序员人生 程序员笑话 编程技术 红包 知识店铺 --> 首页 Android 鸡汤 逗乐 Search Ja ...
- Spring Boot 2 实战:如何自定义 Servlet Filter
1.前言 有些时候我们需要在 Spring Boot Servlet Web 应用中声明一些自定义的 Servlet Filter 来处理一些逻辑.比如简单的权限系统.请求头过滤.防止 XSS 攻击等 ...
- Mysql 分组查询出现'this is incompatible with sql_mode=only_full_group_by'的解决办法
由于Mysql自动开启了 only_full_group_by,所以若查询的字段不在group by里面,则分组报错. 解决办法其一:mysql配置,关闭only_full_group_by,这种办法 ...
- 创业复盘实战营总结----HHR计划----创业课
一句话总结课程核心点. 一共4节在线课: 第一节课:<创业学习> 投资人最看重的是CEO的快速学习能力,根据IPO思维模型,如果一共CEO每天input大量的信息,高效的process,而 ...
- SSH项目Dao层和Service层及Action的重用
泛型 1.泛型的定义 1.泛型是一种类型 1.关于Type //是一个标示接口,该标示接口描述的意义是代表所有的类型 public interface Typ ...
- PCF8591 AD/DA模块使用详解
I2C PCF8591 8位AD/DA转换 BCM2835 Library 1.PCF8591T简述 PCF8591器件图如下: PCF8591是一个8位的CMOS数据采集器件,具有4个模拟输入(其中 ...
- C#操作Word的超详细总结 ---转载
C#操作Word的超详细总结 本文中用C#来操作Word,包括: 创建Word: 插入文字,选择文字,编辑文字的字号.粗细.颜色.下划线等: 设置段落的首行缩进.行距: 设置页面页边距和纸张大小: 设 ...
- docker进入交互界面
进入cmd交互界面 docker run -it python:3.5 /bin/bash 退出 exit ctrl + d
- JVM虚拟机内存溢出垃圾收集及类加载机制总结
1.Java内存区域与内存溢出异常 虚拟机栈:为虚拟机执行Java方法服务 本地方法栈:为虚拟机使用到的native方法服务. Java堆:是Java虚拟机所管理的内存中最大的一块,被所有线程共享的一 ...