@@ -66,8 +66,6 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping i
66
66
@ Nullable
67
67
private Object rootHandler ;
68
68
69
- private boolean useTrailingSlashMatch = false ;
70
-
71
69
private boolean lazyInitHandlers = false ;
72
70
73
71
private final Map <String , Object > handlerMap = new LinkedHashMap <>();
@@ -101,28 +99,6 @@ public Object getRootHandler() {
101
99
return this .rootHandler ;
102
100
}
103
101
104
- /**
105
- * Whether to match to URLs irrespective of the presence of a trailing slash.
106
- * If enabled a URL pattern such as "/users" also matches to "/users/".
107
- * <p>The default value is {@code false}.
108
- * @deprecated as of 6.0, see
109
- * {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
110
- */
111
- @ Deprecated (since = "6.0" )
112
- public void setUseTrailingSlashMatch (boolean useTrailingSlashMatch ) {
113
- this .useTrailingSlashMatch = useTrailingSlashMatch ;
114
- if (getPatternParser () != null ) {
115
- getPatternParser ().setMatchOptionalTrailingSeparator (useTrailingSlashMatch );
116
- }
117
- }
118
-
119
- /**
120
- * Whether to match to URLs irrespective of the presence of a trailing slash.
121
- */
122
- public boolean useTrailingSlashMatch () {
123
- return this .useTrailingSlashMatch ;
124
- }
125
-
126
102
/**
127
103
* Set whether to lazily initialize handlers. Only applicable to
128
104
* singleton handlers, as prototypes are always lazily initialized.
@@ -360,11 +336,6 @@ protected Object lookupHandler(String lookupPath, HttpServletRequest request) th
360
336
if (getPathMatcher ().match (registeredPattern , lookupPath )) {
361
337
matchingPatterns .add (registeredPattern );
362
338
}
363
- else if (useTrailingSlashMatch ()) {
364
- if (!registeredPattern .endsWith ("/" ) && getPathMatcher ().match (registeredPattern + "/" , lookupPath )) {
365
- matchingPatterns .add (registeredPattern + "/" );
366
- }
367
- }
368
339
}
369
340
370
341
String bestMatch = null ;
@@ -495,11 +466,6 @@ public RequestMatchResult match(HttpServletRequest request, String pattern) {
495
466
if (getPathMatcher ().match (pattern , lookupPath )) {
496
467
return new RequestMatchResult (pattern , lookupPath , getPathMatcher ());
497
468
}
498
- else if (useTrailingSlashMatch ()) {
499
- if (!pattern .endsWith ("/" ) && getPathMatcher ().match (pattern + "/" , lookupPath )) {
500
- return new RequestMatchResult (pattern + "/" , lookupPath , getPathMatcher ());
501
- }
502
- }
503
469
return null ;
504
470
}
505
471
0 commit comments