配置了异常accessDeniedHandler被全局异常捕获了不生效
//配置异常处理器
//认证失败处理器
http.exceptionHandling()
.authenticationEntryPoint(authenticationEntryPoint)
//授权失败处理器
.accessDeniedHandler(accessDeniedHandler);
@ExceptionHandler(AccessDeniedException.class)
public void accessDeniedException(AccessDeniedException accessDeniedException) throws AccessDeniedException {
log.error(accessDeniedException.getMessage(), accessDeniedException);
throw accessDeniedException;
}
标签:accessDeniedException,AccessDeniedException,authenticationEntryPoint,处理器,accessD
From: https://www.cnblogs.com/Arborblog/p/16741449.html