exceptionHandling

fun exceptionHandling(exceptionHandlingConfiguration: ExceptionHandlingDsl.() -> Unit)

Allows configuring exception handling.

Example:

@Configuration
@EnableWebSecurity
class SecurityConfig {

@Bean
fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
http {
exceptionHandling {
accessDeniedPage = "/access-denied"
}
}
return http.build()
}
}

Parameters

exceptionHandlingConfiguration

custom configuration to apply to the exception handling

See also