大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
首先说下,其实url-pattern就是说的url模式,就是容器在查找时根据这个模式来找到具体的servlet来执行。
先来看一段规范中的
In the Web application deployment descriptor, the following syntax is used to define mappings:
- A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used for path mapping.
- A string beginning with a ‘*.’ prefix is used as an extension mapping.
- A string containing only the ’/’ character indicates the “default” servlet of the application.
- All other strings are used for exact matches only.–这一句不是规范
翻译下来就是:
在web.xml文件中,以下语法用于定义映射:
以”/’开头和以”/*”结尾的是用来做路径映射的。
以前缀”*.”开头的是用来做扩展映射的。如*.action
“/” 是用来定义default servlet映射的。
其它所的有就是用来精确匹配的。
但是有时我们也能够遇到/app/**的,这种情况下一般是Ant的表示语法,也是精确匹配(见标注)
这个可以参考:
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/210073.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...