From fe4dcc2fb60990abb60af28acf61d294ceca8ad2 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Mon, 2 Jun 2025 16:19:01 +0700 Subject: [PATCH] Update HttpSecurity javadoc Signed-off-by: Tran Ngoc Nhan --- .../config/annotation/web/builders/HttpSecurity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java index 0727ba33bdf..ed84d980164 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java @@ -107,7 +107,7 @@ * A {@link HttpSecurity} is similar to Spring Security's XML <http> element in the * namespace configuration. It allows configuring web based security for specific http * requests. By default it will be applied to all requests, but can be restricted using - * {@link #requestMatcher(RequestMatcher)} or other similar methods. + * {@link #authorizeHttpRequests(Customizer)} or other similar methods. * *

Example Usage

* @@ -124,7 +124,12 @@ * * @Bean * public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - * http.authorizeHttpRequests().requestMatchers("/**").hasRole("USER").and().formLogin(); + * http + * .authorizeHttpRequests((authorizeHttpRequests) -> + * authorizeHttpRequests + * .requestMatchers("/**").hasRole("USER") + * ) + * .formLogin(withDefaults()); * return http.build(); * } *