Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 与之间的差异/**_Url_Spring Mvc - Fatal编程技术网

Url 与之间的差异/**

Url 与之间的差异/**,url,spring-mvc,Url,Spring Mvc,我混淆了URL模式/和/**w.r.tAntPAthMatcher 我知道/**是一种通用模式,可以匹配所有URL,但我不确定/会匹配什么 我已尝试搜索差异,但没有帮助。/***将匹配路径中的任意数量(0或更多)级别,例如,它将同时匹配/file和/some/path/file 单个星号/*仅匹配0个或多个字符(不是路径级别),因此它将匹配/file,而不是/some/path/file 单斜杠/仅与根路径匹配。/**将与路径中的任意数量(0或更多)级别匹配,例如,它将同时与/file和/som

我混淆了URL模式
/
/**
w.r.t
AntPAthMatcher

我知道
/**
是一种通用模式,可以匹配所有URL,但我不确定
/
会匹配什么


我已尝试搜索差异,但没有帮助。

/***
将匹配路径中的任意数量(0或更多)级别,例如,它将同时匹配
/file
/some/path/file

单个星号
/*
仅匹配0个或多个字符(不是路径级别),因此它将匹配
/file
,而不是
/some/path/file


单斜杠
/
仅与根路径匹配。

/**
将与路径中的任意数量(0或更多)级别匹配,例如,它将同时与
/file
/some/path/file
匹配

单个星号
/*
仅匹配0个或多个字符(不是路径级别),因此它将匹配
/file
,而不是
/some/path/file


单个斜杠
/
只会匹配根路径。

谢谢,在web.xml中,当我们为例如spring mvc dispatcher servlet指定servlet url映射时,我们使用/而不是/**将所有请求传递给dispatcher servlet,它的工作方式与AntPathMatcher不同?是的,非常不同/*将匹配所有路径
AntPathMatcher
基于Apache Ant的路径模式。谢谢,在web.xml中,当我们为例如spring mvc dispatcher servlet指定servlet url映射时,我们使用/而不是/**将所有请求传递给dispatcher servlet,它的工作方式与AntPathMatcher不同?是的,非常不同/*将匹配所有路径<代码>AntPathMatcher基于ApacheAnt的路径模式。