gpt4 book ai didi

java - Ant 路径样式模式

转载 作者:IT老高 更新时间:2023-10-28 11:39:13 26 4
gpt4 key购买 nike

Ant path style patterns的规则是什么。

Ant 网站本身信息量惊人地不足。

最佳答案

中的 Ant 样式路径模式匹配:

The mapping matches URLs using the following rules:

  • ? matches one character
  • * matches zero or more characters
  • ** matches zero or more 'directories' in a path
  • {spring:[a-z]+} matches the regexp [a-z]+ as a path variable named "spring"

Some examples:

  • com/t?st.jsp - matches com/test.jsp but also com/tast.jsp or com/txst.jsp
  • com/*.jsp - matches all .jsp files in the com directory
  • com/**/test.jsp - matches all test.jsp files underneath the com path
  • org/springframework/**/*.jsp - matches all .jsp files underneath the org/springframework path
  • org/**/servlet/bla.jsp - matches org/springframework/servlet/bla.jsp but also org/springframework/testing/servlet/bla.jsp and org/servlet/bla.jsp
  • com/{filename:\\w+}.jsp will match com/test.jsp and assign the value test to the filename variable

http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html

关于java - Ant 路径样式模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2952196/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com