mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-12-27 02:23:41 +00:00
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:
parent
19cbd9c570
commit
bb7fcb27ef
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user