|
40 | 40 | import org.springframework.web.util.ServletRequestPathUtils;
|
41 | 41 | import org.springframework.web.util.UrlPathHelper;
|
42 | 42 | import org.springframework.web.util.pattern.PathPattern;
|
43 |
| -import org.springframework.web.util.pattern.PathPatternParser; |
44 | 43 |
|
45 | 44 | /**
|
46 | 45 | * Abstract base class for URL-mapped {@link HandlerMapping} implementations.
|
47 | 46 | *
|
48 | 47 | * <p>Supports literal matches and pattern matches such as "/test/*", "/test/**",
|
49 | 48 | * and others. For details on pattern syntax refer to {@link PathPattern} when
|
50 |
| - * parsed patterns are {@link #setPatternParser(PathPatternParser) enabled} or |
51 |
| - * see {@link AntPathMatcher} otherwise. The syntax is largely the same but the |
| 49 | + * parsed patterns are {@link #usesPathPatterns() enabled} or see |
| 50 | + * {@link AntPathMatcher} otherwise. The syntax is largely the same but the |
52 | 51 | * {@code PathPattern} syntax is more tailored for web applications, and its
|
53 | 52 | * implementation is more efficient.
|
54 | 53 | *
|
@@ -135,7 +134,7 @@ public void setLazyInitHandlers(boolean lazyInitHandlers) {
|
135 | 134 | protected Object getHandlerInternal(HttpServletRequest request) throws Exception {
|
136 | 135 | String lookupPath = initLookupPath(request);
|
137 | 136 | Object handler;
|
138 |
| - if (getPatternParser() != null) { |
| 137 | + if (usesPathPatterns()) { |
139 | 138 | RequestPath path = ServletRequestPathUtils.getParsedRequestPath(request);
|
140 | 139 | handler = lookupHandler(path, lookupPath, request);
|
141 | 140 | }
|
@@ -167,8 +166,7 @@ protected Object getHandlerInternal(HttpServletRequest request) throws Exception
|
167 | 166 |
|
168 | 167 | /**
|
169 | 168 | * Look up a handler instance for the given URL path. This method is used
|
170 |
| - * when parsed {@code PathPattern}s are |
171 |
| - * {@link #setPatternParser(PathPatternParser) enabled}. |
| 169 | + * when parsed {@code PathPattern}s are {@link #usesPathPatterns() enabled}. |
172 | 170 | * @param path the parsed RequestPath
|
173 | 171 | * @param lookupPath the String lookupPath for checking direct hits
|
174 | 172 | * @param request current HTTP request
|
@@ -462,8 +460,8 @@ public final Map<String, Object> getHandlerMap() {
|
462 | 460 | }
|
463 | 461 |
|
464 | 462 | /**
|
465 |
| - * Identical to {@link #getHandlerMap()} but with parsed patterns when |
466 |
| - * {@link #setPatternParser(PathPatternParser)} is set, or otherwise empty. |
| 463 | + * Identical to {@link #getHandlerMap()} but populated when parsed patterns |
| 464 | + * are {@link #usesPathPatterns() enabled}; otherwise empty. |
467 | 465 | * @since 5.3
|
468 | 466 | */
|
469 | 467 | public final Map<PathPattern, Object> getPathPatternHandlerMap() {
|
|
0 commit comments