Browse Source

Merge branch '5.1.x'

pull/22758/head
Sam Brannen 6 years ago
parent
commit
021909dac2
  1. 26
      spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java

26
spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,16 +40,16 @@ import org.springframework.util.StringUtils; @@ -40,16 +40,16 @@ import org.springframework.util.StringUtils;
* <li>{@code ?} matches one character</li>
* <li>{@code *} matches zero or more characters within a path segment</li>
* <li>{@code **} matches zero or more <em>path segments</em> until the end of the path</li>
* <li>{@code {spring}} matches a <em>path segment</em> and captures it as a variable named "spring"</li>
* <li>{@code {spring:[a-z]+}} matches the regexp {@code [a-z]+} as a path variable named "spring"</li>
* <li>{@code {*spring}} matches zero or more <em>path segments</em> until the end of the path
* <li><code>{spring}</code> matches a <em>path segment</em> and captures it as a variable named "spring"</li>
* <li><code>{spring:[a-z]+}</code> matches the regexp {@code [a-z]+} as a path variable named "spring"</li>
* <li><code>{*spring}</code> matches zero or more <em>path segments</em> until the end of the path
* and captures it as a variable named "spring"</li>
* </ul>
*
* <h3>Examples</h3>
* <ul>
* <li>{@code /pages/t?st.html} &mdash; matches {@code /pages/test.html} but also
* {@code /pages/tast.html} but not {@code /pages/toast.html}</li>
* <li>{@code /pages/t?st.html} &mdash; matches {@code /pages/test.html} as well as
* {@code /pages/tXst.html} but not {@code /pages/toast.html}</li>
* <li>{@code /resources/*.png} &mdash; matches all {@code .png} files in the
* {@code resources} directory</li>
* <li><code>/resources/&#42;&#42;</code> &mdash; matches all files
@ -58,9 +58,9 @@ import org.springframework.util.StringUtils; @@ -58,9 +58,9 @@ import org.springframework.util.StringUtils;
* <li><code>/resources/{&#42;path}</code> &mdash; matches all files
* underneath the {@code /resources/} path and captures their relative path in
* a variable named "path"; {@code /resources/image.png} will match with
* "spring" -> "/image.png", and {@code /resources/css/spring.css} will match
* with "spring" -> "/css/spring.css"</li>
* <li>{@code /resources/{filename:\\w+}.dat} will match {@code /resources/spring.dat}
* "spring" &rarr; "/image.png", and {@code /resources/css/spring.css} will match
* with "spring" &rarr; "/css/spring.css"</li>
* <li><code>/resources/{filename:\\w+}.dat</code> will match {@code /resources/spring.dat}
* and assign the value {@code "spring"} to the {@code filename} variable</li>
* </ul>
*
@ -260,10 +260,10 @@ public class PathPattern implements Comparable<PathPattern> { @@ -260,10 +260,10 @@ public class PathPattern implements Comparable<PathPattern> {
/**
* Determine the pattern-mapped part for the given path.
* <p>For example: <ul>
* <li>'{@code /docs/cvs/commit.html}' and '{@code /docs/cvs/commit.html} -> ''</li>
* <li>'{@code /docs/*}' and '{@code /docs/cvs/commit}' -> '{@code cvs/commit}'</li>
* <li>'{@code /docs/cvs/*.html}' and '{@code /docs/cvs/commit.html} -> '{@code commit.html}'</li>
* <li>'{@code /docs/**}' and '{@code /docs/cvs/commit} -> '{@code cvs/commit}'</li>
* <li>'{@code /docs/cvs/commit.html}' and '{@code /docs/cvs/commit.html} &rarr; ''</li>
* <li>'{@code /docs/*}' and '{@code /docs/cvs/commit}' &rarr; '{@code cvs/commit}'</li>
* <li>'{@code /docs/cvs/*.html}' and '{@code /docs/cvs/commit.html} &rarr; '{@code commit.html}'</li>
* <li>'{@code /docs/**}' and '{@code /docs/cvs/commit} &rarr; '{@code cvs/commit}'</li>
* </ul>
* <p><b>Notes:</b>
* <ul>

Loading…
Cancel
Save