3838 * (that is, it should exclude any context path).
3939 *
4040 * <p>
41- * You can provide the servlet path in {@link PathPatternRequestMatcher#servletPath} and
42- * reuse for multiple matchers.
41+ * You can provide the servlet path in {@link PathPatternRequestMatcher.Builder#basePath}
42+ * and reuse for multiple matchers.
4343 *
4444 * <p>
4545 * Note that the {@link org.springframework.web.servlet.HandlerMapping} that contains the
@@ -55,14 +55,12 @@ public final class PathPatternRequestMatcher implements RequestMatcher {
5555
5656 private final PathPattern pattern ;
5757
58- private RequestMatcher servletPath = AnyRequestMatcher .INSTANCE ;
59-
6058 private RequestMatcher method = AnyRequestMatcher .INSTANCE ;
6159
6260 /**
6361 * Creates a {@link PathPatternRequestMatcher} that uses the provided {@code pattern}.
6462 * <p>
65- * The {@code pattern} should be relative to the servlet path
63+ * The {@code pattern} should be relative to the context path
6664 * </p>
6765 * @param pattern the pattern used to match
6866 */
@@ -102,9 +100,6 @@ public boolean matches(HttpServletRequest request) {
102100 */
103101 @ Override
104102 public MatchResult matcher (HttpServletRequest request ) {
105- if (!this .servletPath .matches (request )) {
106- return MatchResult .notMatch ();
107- }
108103 if (!this .method .matches (request )) {
109104 return MatchResult .notMatch ();
110105 }
@@ -232,8 +227,9 @@ public Builder basePath(String basePath) {
232227 * also be followed by {@code /**} to signify all URIs under a given path.
233228 *
234229 * <p>
235- * These must be specified relative to any servlet path prefix (meaning you should
236- * exclude the context path and any servlet path prefix in stating your pattern).
230+ * These must be specified relative to any context path prefix. A
231+ * {@link #basePath} may be specified to reuse a common prefix, for example a
232+ * servlet path.
237233 *
238234 * <p>
239235 * The following are valid patterns and their meaning
@@ -266,8 +262,9 @@ public PathPatternRequestMatcher matcher(String path) {
266262 * also be followed by {@code /**} to signify all URIs under a given path.
267263 *
268264 * <p>
269- * These must be specified relative to any servlet path prefix (meaning you should
270- * exclude the context path and any servlet path prefix in stating your pattern).
265+ * These must be specified relative to any context path prefix. A
266+ * {@link #basePath} may be specified to reuse a common prefix, for example a
267+ * servlet path.
271268 *
272269 * <p>
273270 * The following are valid patterns and their meaning
0 commit comments