Skip to content

Commit 52f6641

Browse files
committed
Improve VersionResourceResolve javadoc
The `pathPatterns` args are relative to the patterns configured for the resource handler. Issue: SPR-14817
1 parent 885e76b commit 52f6641

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

spring-web-reactive/src/main/java/org/springframework/web/reactive/resource/VersionResourceResolver.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public Map<String, VersionStrategy> getStrategyMap() {
9696
* default strategy to use except when it cannot be, for example when using
9797
* JavaScript module loaders, use {@link #addFixedVersionStrategy} instead
9898
* for serving JavaScript files.
99-
* @param pathPatterns one or more resource URL path patterns
99+
* @param pathPatterns one or more resource URL path patterns,
100+
* relative to the pattern configured with the resource handler
100101
* @return the current instance for chained method invocation
101102
* @see ContentVersionStrategy
102103
*/
@@ -118,7 +119,8 @@ public VersionResourceResolver addContentVersionStrategy(String... pathPatterns)
118119
* will also cofigure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
119120
* {@code version} String given as an argument.
120121
* @param version a version string
121-
* @param pathPatterns one or more resource URL path patterns
122+
* @param pathPatterns one or more resource URL path patterns,
123+
* relative to the pattern configured with the resource handler
122124
* @return the current instance for chained method invocation
123125
* @see FixedVersionStrategy
124126
*/
@@ -139,7 +141,8 @@ public VersionResourceResolver addFixedVersionStrategy(String version, String...
139141
* Register a custom VersionStrategy to apply to resource URLs that match the
140142
* given path patterns.
141143
* @param strategy the custom strategy
142-
* @param pathPatterns one or more resource URL path patterns
144+
* @param pathPatterns one or more resource URL path patterns,
145+
* relative to the pattern configured with the resource handler
143146
* @return the current instance for chained method invocation
144147
* @see VersionStrategy
145148
*/

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/VersionResourceResolver.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public Map<String, VersionStrategy> getStrategyMap() {
9494
* default strategy to use except when it cannot be, for example when using
9595
* JavaScript module loaders, use {@link #addFixedVersionStrategy} instead
9696
* for serving JavaScript files.
97-
* @param pathPatterns one or more resource URL path patterns
97+
* @param pathPatterns one or more resource URL path patterns,
98+
* relative to the pattern configured with the resource handler
9899
* @return the current instance for chained method invocation
99100
* @see ContentVersionStrategy
100101
*/
@@ -116,7 +117,8 @@ public VersionResourceResolver addContentVersionStrategy(String... pathPatterns)
116117
* will also cofigure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
117118
* {@code version} String given as an argument.
118119
* @param version a version string
119-
* @param pathPatterns one or more resource URL path patterns
120+
* @param pathPatterns one or more resource URL path patterns,
121+
* relative to the pattern configured with the resource handler
120122
* @return the current instance for chained method invocation
121123
* @see FixedVersionStrategy
122124
*/
@@ -137,7 +139,8 @@ public VersionResourceResolver addFixedVersionStrategy(String version, String...
137139
* Register a custom VersionStrategy to apply to resource URLs that match the
138140
* given path patterns.
139141
* @param strategy the custom strategy
140-
* @param pathPatterns one or more resource URL path patterns
142+
* @param pathPatterns one or more resource URL path patterns,
143+
* relative to the pattern configured with the resource handler
141144
* @return the current instance for chained method invocation
142145
* @see VersionStrategy
143146
*/

0 commit comments

Comments
 (0)