Wildcard | Description |
---|---|
? | 匹配任何单字符 |
* | 匹配0或者任意数量的字符 |
** | 匹配0或者更多的目录 |
3、举例说明:
1、 /views/products/**/*.cfm
# Matches /views/products/index.cfm /views/products/SE10/index.cfm /views/products/SE10/details.cfm /views/products/ST80/index.cfm /views/products/ST80/details.cfm # Does Not Match: /views/index.cfm /views/aboutUs/index.cfm /views/aboutUs/managementTeam.cfm
2、 /views/**/*.cfm
# Matches: /views/index.cfm /views/aboutUs/index.cfm /views/aboutUs/managementTeam.cfm /views/products/index.cfm /views/products/SE10/index.cfm /views/products/SE10/details.cfm /views/products/ST80/index.cfm /views/products/ST80/details.cfm # Does Not Match: /views/index.htm /views/readme.txt
3、 /views/index??.cfm
# Matches: /views/index01.cfm /views/index02.cfm /views/indexAA.cfm # Does Not Match: /views/index01.htm /views/index1.cfm /views/indexA.cfm /views/indexOther.cfm /views/anotherDir/index01.cfm
如果知道这些我们就能够在Spring MVC灵活的配置url映射了。
如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!