Help me please
The error says I’m missing a “)” but when I use it, I get this.
try using the “)”
@Configuration
public class SpringSeguridadConfiguracion
{
@Bean
public SecurityFilterChain CadenaDeFiltracion(HttpSecurity http) throws Exception
{
http.authorizeHttpRequests((authz) -> authz
.requestMatchers("/","/listar").permitAll()
.requestMatchers("/form/**").hasAnyRole("ADMIN")
.requestMatchers("/eliminar/**").hasAnyRole("ADMIN")
.requestMatchers("/editar/**").hasAnyRole("ADMIN")
.requestMatchers("/ver/**").hasAnyRole("USER")
.anyRequest().authenticated()
//LOGIN - LOGOUT
.and()
.formLogin().loginPage("/login")
.permitAll()
.and()
.logout().permitAll()
.and()
//Error
.exceptionHandling()
.accessDeniedPage("/error_403"));
return http.build();
}
}
These are the messages
Multiple markers at this line
- Unhandled exception type Exception
- Unhandled exception type Exception
- Consider switching to ‘HttpSecurity’ Lambda DSL syntax
- Unhandled exception type Exception