In Spring Boot, to capture and handle the MethodArgumentNotValidException, the _____ method in a controller advice can be used.

  • @ControllerAdvice
  • @ExceptionHandler
  • @ModelAttribute
  • @Validated
In Spring Boot, to capture and handle the MethodArgumentNotValidException, the @ControllerAdvice annotation is used. It allows you to define global exception handling for your controllers. The @ExceptionHandler annotation is then used within the controller advice class to specify methods that handle specific exceptions, including MethodArgumentNotValidException.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *