Skip to content

Commit 61d6fbc

Browse files
committed
Update Documentation for PathPatternRequestMatcher
Issue gh-16765
1 parent 0ab01ea commit 61d6fbc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/modules/ROOT/pages/migration-7/web.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -401,19 +401,19 @@ Instead of taking this responsibility away from developers, now it is simpler to
401401

402402
[method,java]
403403
----
404-
PathPatternRequestParser.Builder servlet = PathPatternRequestParser.servletPath("/mvc");
404+
PathPatternRequestParser.Builder servlet = PathPatternRequestParser.withDefaults().basePath("/mvc");
405405
http
406406
.authorizeHttpRequests((authorize) -> authorize
407407
.requestMatchers(servlet.pattern("/orders/**").matcher()).authenticated()
408408
)
409409
----
410410

411411

412-
For paths that belong to the default servlet, use `PathPatternRequestParser.path()` instead:
412+
For paths that belong to the default servlet, use `PathPatternRequestParser.withDefaults()` instead:
413413

414414
[method,java]
415415
----
416-
PathPatternRequestParser.Builder request = PathPatternRequestParser.path();
416+
PathPatternRequestParser.Builder request = PathPatternRequestParser.withDefaults();
417417
http
418418
.authorizeHttpRequests((authorize) -> authorize
419419
.requestMatchers(request.pattern("/js/**").matcher()).authenticated()

docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ import static org.springframework.security.web.servlet.util.matcher.PathPatternR
594594
595595
@Bean
596596
SecurityFilterChain appEndpoints(HttpSecurity http) {
597-
PathPatternRequestMatcher.Builder mvc = withDefaults().servletPath("/spring-mvc");
597+
PathPatternRequestMatcher.Builder mvc = withDefaults().basePath("/spring-mvc");
598598
http
599599
.authorizeHttpRequests((authorize) -> authorize
600600
.requestMatchers(mvc.matcher("/admin/**")).hasAuthority("admin")

0 commit comments

Comments
 (0)