回答:
一致するAntスタイルのパスパターン 春のフレームワーク:
マッピングは、次のルールを使用してURLと一致します。
?1文字に一致*ゼロ個以上の文字に一致します**パスの0個以上の「ディレクトリ」に一致します{spring:[a-z]+}[a-z]+「春」という名前のパス変数として正規表現に一致しますいくつかの例:
com/t?st.jsp-com / test.jspに一致しますが、com/tast.jspまたはcom/txst.jspcom/*.jsp- ディレクトリ.jsp内のすべてのファイルに一致しますcomcom/**/test.jsp- パスのtest.jsp下にあるすべてのファイルに一致しますcomorg/springframework/**/*.jsp-の.jsp下にあるすべてのファイルに一致しますorg/springframework pathorg/**/servlet/bla.jsp-一致するorg/springframework/servlet/bla.jspだけでなくorg/springframework/testing/servlet/bla.jsp、org/servlet/bla.jspcom/{filename:\\w+}.jspcom/test.jsp値testを照合してfilename変数に割り当てます
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/AntPathMatcher.html
spring-framework-referenceうまく説明内の説明がコンテキストに入れます:https : //docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping-uri-templates。
パスパターンの使い方のことだと思います
スラッシュとバックスラッシュのどちらを使用するかについては、これらは実行時に使用されるプラットフォーム上のパス区切り文字に変換されます。
ユーティリティは3つの異なるワイルドカードを使用します。
+----------+-----------------------------------+
| Wildcard | Description |
+----------+-----------------------------------+
| * | Matches zero or more characters. |
| ? | Matches exactly one character. |
| ** | Matches zero or more directories. |
+----------+-----------------------------------+
@user11153より読みやすい形式のテーブルを使用することにより、最も賛成された回答。
マッピングは、次のルールを使用してURLと一致します。
+-----------------+---------------------------------------------------------+
| Wildcard | Description |
+-----------------+---------------------------------------------------------+
| ? | Matches exactly one character. |
| * | Matches zero or more characters. |
| ** | Matches zero or more 'directories' in a path |
| {spring:[a-z]+} | Matches regExp [a-z]+ as a path variable named "spring" |
+-----------------+---------------------------------------------------------+
いくつかの例:
+------------------------------+--------------------------------------------------------+
| Example | Matches: |
+------------------------------+--------------------------------------------------------+
| com/t?st.jsp | com/test.jsp but also com/tast.jsp or com/txst.jsp |
| com/*.jsp | All .jsp files in the com directory |
| com/**/test.jsp | All test.jsp files underneath the com path |
| org/springframework/**/*.jsp | All .jsp files underneath the org/springframework path |
| org/**/servlet/bla.jsp | org/springframework/servlet/bla.jsp |
| also: | org/springframework/testing/servlet/bla.jsp |
| also: | org/servlet/bla.jsp |
| com/{filename:\\w+}.jsp | com/test.jsp & assign value test to filename variable |
+------------------------------+--------------------------------------------------------+
@ user11153で述べたように、SpringのAntPathMatcherは、Antスタイルのパスパターンマッチングの基本を実装して文書化します。
さらに、Java 7のnio APIには、FileSystem.getPathMatcherを介した基本的なパターンマッチングの組み込みサポートがいくつか追加されています。