1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 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.
23
23
import org .springframework .lang .Nullable ;
24
24
import org .springframework .util .AntPathMatcher ;
25
25
import org .springframework .util .PathMatcher ;
26
- import org .springframework .web .servlet .mvc .method .annotation .RequestMappingHandlerMapping ;
27
26
import org .springframework .web .util .UrlPathHelper ;
28
27
import org .springframework .web .util .pattern .PathPattern ;
29
28
import org .springframework .web .util .pattern .PathPatternParser ;
@@ -49,18 +48,9 @@ public class PathMatchConfigurer {
49
48
@ Nullable
50
49
private PathPatternParser patternParser ;
51
50
52
- @ Nullable
53
- private Boolean trailingSlashMatch ;
54
-
55
51
@ Nullable
56
52
private Map <String , Predicate <Class <?>>> pathPrefixes ;
57
53
58
- @ Nullable
59
- private Boolean suffixPatternMatch ;
60
-
61
- @ Nullable
62
- private Boolean registeredSuffixPatternMatch ;
63
-
64
54
@ Nullable
65
55
private UrlPathHelper urlPathHelper ;
66
56
@@ -84,8 +74,6 @@ public class PathMatchConfigurer {
84
74
* <p><strong>Note:</strong> This property is mutually exclusive with the
85
75
* following other, {@code AntPathMatcher} related properties:
86
76
* <ul>
87
- * <li>{@link #setUseSuffixPatternMatch(Boolean)}
88
- * <li>{@link #setUseRegisteredSuffixPatternMatch(Boolean)}
89
77
* <li>{@link #setUrlPathHelper(UrlPathHelper)}
90
78
* <li>{@link #setPathMatcher(PathMatcher)}
91
79
* </ul>
@@ -103,20 +91,6 @@ public PathMatchConfigurer setPatternParser(@Nullable PathPatternParser patternP
103
91
return this ;
104
92
}
105
93
106
- /**
107
- * Whether to match to URLs irrespective of the presence of a trailing slash.
108
- * If enabled a method mapped to "/users" also matches to "/users/".
109
- * <p>The default was changed in 6.0 from {@code true} to {@code false} in
110
- * order to support the deprecation of the property.
111
- * @deprecated as of 6.0, see
112
- * {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
113
- */
114
- @ Deprecated (since = "6.0" )
115
- public PathMatchConfigurer setUseTrailingSlashMatch (Boolean trailingSlashMatch ) {
116
- this .trailingSlashMatch = trailingSlashMatch ;
117
- return this ;
118
- }
119
-
120
94
/**
121
95
* Configure a path prefix to apply to matching controller methods.
122
96
* <p>Prefixes are used to enrich the mappings of every {@code @RequestMapping}
@@ -136,49 +110,6 @@ public PathMatchConfigurer addPathPrefix(String prefix, Predicate<Class<?>> pred
136
110
return this ;
137
111
}
138
112
139
- /**
140
- * Whether to use suffix pattern match (".*") when matching patterns to
141
- * requests. If enabled a method mapped to "/users" also matches to "/users.*".
142
- * <p><strong>Note:</strong> This property is mutually exclusive with
143
- * {@link #setPatternParser(PathPatternParser)}. If set, it enables use of
144
- * String path matching, unless a {@code PathPatternParser} is also
145
- * explicitly set in which case this property is ignored.
146
- * <p>By default this is set to {@code false}.
147
- * @deprecated as of 5.2.4. See class-level note in
148
- * {@link RequestMappingHandlerMapping} on the deprecation of path extension
149
- * config options. As there is no replacement for this method, in 5.2.x it is
150
- * necessary to set it to {@code false}. In 5.3 the default changes to
151
- * {@code false} and use of this property becomes unnecessary.
152
- */
153
- @ Deprecated
154
- public PathMatchConfigurer setUseSuffixPatternMatch (@ Nullable Boolean suffixPatternMatch ) {
155
- this .suffixPatternMatch = suffixPatternMatch ;
156
- this .preferPathMatcher |= (suffixPatternMatch != null && suffixPatternMatch );
157
- return this ;
158
- }
159
-
160
- /**
161
- * Whether suffix pattern matching should work only against path extensions
162
- * explicitly registered when you
163
- * {@link WebMvcConfigurer#configureContentNegotiation configure content
164
- * negotiation}. This is generally recommended to reduce ambiguity and to
165
- * avoid issues such as when a "." appears in the path for other reasons.
166
- * <p><strong>Note:</strong> This property is mutually exclusive with
167
- * {@link #setPatternParser(PathPatternParser)}. If set, it enables use of
168
- * String path matching, unless a {@code PathPatternParser} is also
169
- * explicitly set in which case this property is ignored.
170
- * <p>By default this is set to "false".
171
- * @deprecated as of 5.2.4. See class-level note in
172
- * {@link RequestMappingHandlerMapping} on the deprecation of path extension
173
- * config options.
174
- */
175
- @ Deprecated
176
- public PathMatchConfigurer setUseRegisteredSuffixPatternMatch (@ Nullable Boolean registeredSuffixPatternMatch ) {
177
- this .registeredSuffixPatternMatch = registeredSuffixPatternMatch ;
178
- this .preferPathMatcher |= (registeredSuffixPatternMatch != null && registeredSuffixPatternMatch );
179
- return this ;
180
- }
181
-
182
113
/**
183
114
* Set the UrlPathHelper to use to resolve the mapping path for the application.
184
115
* <p><strong>Note:</strong> This property is mutually exclusive with
@@ -232,39 +163,11 @@ public PathPatternParser getPatternParser() {
232
163
return this .patternParser ;
233
164
}
234
165
235
- @ Nullable
236
- @ Deprecated
237
- public Boolean isUseTrailingSlashMatch () {
238
- return this .trailingSlashMatch ;
239
- }
240
-
241
166
@ Nullable
242
167
protected Map <String , Predicate <Class <?>>> getPathPrefixes () {
243
168
return this .pathPrefixes ;
244
169
}
245
170
246
- /**
247
- * Whether to use registered suffixes for pattern matching.
248
- * @deprecated as of 5.2.4, see deprecation note on
249
- * {@link #setUseRegisteredSuffixPatternMatch(Boolean)}.
250
- */
251
- @ Nullable
252
- @ Deprecated
253
- public Boolean isUseRegisteredSuffixPatternMatch () {
254
- return this .registeredSuffixPatternMatch ;
255
- }
256
-
257
- /**
258
- * Whether to use registered suffixes for pattern matching.
259
- * @deprecated as of 5.2.4, see deprecation note on
260
- * {@link #setUseSuffixPatternMatch(Boolean)}.
261
- */
262
- @ Nullable
263
- @ Deprecated
264
- public Boolean isUseSuffixPatternMatch () {
265
- return this .suffixPatternMatch ;
266
- }
267
-
268
171
@ Nullable
269
172
public UrlPathHelper getUrlPathHelper () {
270
173
return this .urlPathHelper ;
0 commit comments