In Spring Boot, the _____ annotation is used to define a method that should be invoked to handle an exception thrown during the execution of controller methods.

  • @ExceptionHandler
  • @ExceptionResolver
  • @ControllerAdvice
  • @ExceptionAdvice
In Spring Boot, the @ExceptionHandler annotation is used to define a method that should be invoked to handle an exception thrown during the execution of controller methods. This annotation allows you to specify a method that will handle exceptions specific to a particular controller or globally across all controllers. The other options are not used for this purpose in Spring Boot.
Add your answer
Loading...

Leave a comment

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