docs: Fix example in MyCustomDsl to remove throws Exception

In `init` and `configure`, throws Exception has been removed in the super interface `SecurityConfigurer`, since Spring Security 7.0.
This change is the consequence of https://github.com/spring-projects/spring-security/issues/17957

Signed-off-by: Guillaume Husta <guillaume.husta@gmail.com>
This commit is contained in:
Guillaume Husta 2025-11-26 08:57:43 +01:00 committed by Rob Winch
parent 19cbd9c570
commit bb7fcb27ef

View File

@ -493,14 +493,14 @@ public class MyCustomDsl extends AbstractHttpConfigurer<MyCustomDsl, HttpSecurit
private boolean flag;
@Override
public void init(HttpSecurity http) throws Exception {
public void init(HttpSecurity http) {
// any method that adds another configurer
// must be done in the init method
http.csrf().disable();
}
@Override
public void configure(HttpSecurity http) throws Exception {
public void configure(HttpSecurity http) {
ApplicationContext context = http.getSharedObject(ApplicationContext.class);
// here we lookup from the ApplicationContext. You can also just create a new instance.