Class SpringSecurityResponseEntityExceptionHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
org.hawaiiframework.web.exception.SpringSecurityResponseEntityExceptionHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.MessageSourceAware
@Order(0)
@ControllerAdvice
public class SpringSecurityResponseEntityExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
This class creates proper HTTP response bodies for exceptions.
- Since:
- 6.0.0
-
Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
-
Constructor Summary
ConstructorDescriptionSpringSecurityResponseEntityExceptionHandler
(ErrorResponseEntityBuilder errorResponseEntityBuilder) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
accessDeniedException
(org.springframework.security.access.AccessDeniedException ex, org.springframework.web.context.request.WebRequest request) HandlesAccessDeniedException
instances.Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleErrorResponseException, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource
-
Constructor Details
-
SpringSecurityResponseEntityExceptionHandler
public SpringSecurityResponseEntityExceptionHandler(ErrorResponseEntityBuilder errorResponseEntityBuilder)
-
-
Method Details
-
accessDeniedException
@ExceptionHandler(org.springframework.security.access.AccessDeniedException.class) @ResponseBody public org.springframework.http.ResponseEntity<Object> accessDeniedException(org.springframework.security.access.AccessDeniedException ex, org.springframework.web.context.request.WebRequest request) HandlesAccessDeniedException
instances.The response status is: 403 Forbidden.
- Parameters:
ex
- the exceptionrequest
- the current request- Returns:
- a response entity reflecting the current exception
-