소스 검색

Update Documentation for PathPatternRequestMatcher

Issue gh-16765
Josh Cummings 4 달 전
부모
커밋
61d6fbc2a9
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      docs/modules/ROOT/pages/migration-7/web.adoc
  2. 1 1
      docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc

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

@@ -401,7 +401,7 @@ Instead of taking this responsibility away from developers, now it is simpler to
 
 [method,java]
 ----
-PathPatternRequestParser.Builder servlet = PathPatternRequestParser.servletPath("/mvc");
+PathPatternRequestParser.Builder servlet = PathPatternRequestParser.withDefaults().basePath("/mvc");
 http
     .authorizeHttpRequests((authorize) -> authorize
         .requestMatchers(servlet.pattern("/orders/**").matcher()).authenticated()
@@ -409,11 +409,11 @@ http
 ----
 
 
-For paths that belong to the default servlet, use `PathPatternRequestParser.path()` instead:
+For paths that belong to the default servlet, use `PathPatternRequestParser.withDefaults()` instead:
 
 [method,java]
 ----
-PathPatternRequestParser.Builder request = PathPatternRequestParser.path();
+PathPatternRequestParser.Builder request = PathPatternRequestParser.withDefaults();
 http
     .authorizeHttpRequests((authorize) -> authorize
         .requestMatchers(request.pattern("/js/**").matcher()).authenticated()

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

@@ -594,7 +594,7 @@ import static org.springframework.security.web.servlet.util.matcher.PathPatternR
 
 @Bean
 SecurityFilterChain appEndpoints(HttpSecurity http) {
-	PathPatternRequestMatcher.Builder mvc = withDefaults().servletPath("/spring-mvc");
+	PathPatternRequestMatcher.Builder mvc = withDefaults().basePath("/spring-mvc");
 	http
         .authorizeHttpRequests((authorize) -> authorize
             .requestMatchers(mvc.matcher("/admin/**")).hasAuthority("admin")