File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
spring-web/src/main/java/org/springframework/web/util/pattern Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
64
64
* underneath the {@code /resources/} path, including {@code /resources/image.png}
65
65
* and {@code /resources/css/spring.css}</li>
66
66
* <li><code>/resources/{*path}</code> — matches all files
67
- * underneath the {@code /resources/} path and captures their relative path in
68
- * a variable named "path"; {@code /resources/image.png} will match with
69
- * "path" → "/image.png", and {@code /resources/css/spring.css} will match
70
- * with "path" → "/css/spring.css"</li>
67
+ * underneath the {@code /resources/}, as well as {@code /resources}, and captures
68
+ * their relative path in a variable named "path"; {@code /resources/image.png}
69
+ * will match with "path" → "/image.png", and {@code /resources/css/spring.css}
70
+ * will match with "path" → "/css/spring.css"</li>
71
71
* <li><code>/resources/{filename:\\w+}.dat</code> will match {@code /resources/spring.dat}
72
72
* and assign the value {@code "spring"} to the {@code filename} variable</li>
73
73
* </ul>
Original file line number Diff line number Diff line change @@ -1448,7 +1448,7 @@ You can map requests by using glob patterns and wildcards:
1448
1448
1449
1449
| `+{*path}+`
1450
1450
| Matches zero or more path segments until the end of the path and captures it as a variable named "path"
1451
- | `+"/resources/{*file}"+` matches `+"/resources/images/file.png"+` and captures `+file=images/file.png+`
1451
+ | `+"/resources/{*file}"+` matches `+"/resources/images/file.png"+` and captures `+file=/ images/file.png+`
1452
1452
1453
1453
|===
1454
1454
@@ -1517,7 +1517,7 @@ information or with the `-parameters` compiler flag on Java 8.
1517
1517
1518
1518
The syntax `{*varName}` declares a URI variable that matches zero or more remaining path
1519
1519
segments. For example `/resources/{*path}` matches all files under `/resources/`, and the
1520
- `"path"` variable captures the complete relative path.
1520
+ `"path"` variable captures the complete path under `/resources` .
1521
1521
1522
1522
The syntax `{varName:regex}` declares a URI variable with a regular expression that has the
1523
1523
syntax: `{varName:regex}`. For example, given a URL of `/spring-web-3.0.5.jar`, the following method
You can’t perform that action at this time.
0 commit comments