Class JakartaValidationsEntityExceptionHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
org.hawaiiframework.web.exception.JakartaValidationsEntityExceptionHandler
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware

@Order(0) @ControllerAdvice public class JakartaValidationsEntityExceptionHandler 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Object>
    handleValidationException(jakarta.validation.ValidationException e, org.springframework.web.context.request.WebRequest request)
    Handles ValidationException 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JakartaValidationsEntityExceptionHandler

      public JakartaValidationsEntityExceptionHandler(ErrorResponseEntityBuilder errorResponseEntityBuilder)
  • Method Details

    • handleValidationException

      @ExceptionHandler(jakarta.validation.ValidationException.class) @ResponseBody public org.springframework.http.ResponseEntity<Object> handleValidationException(jakarta.validation.ValidationException e, org.springframework.web.context.request.WebRequest request)
      Handles ValidationException instances.

      The response status is: 400 Bad Request.

      Parameters:
      e - the exception
      request - the current request
      Returns:
      a response entity reflecting the current exception