To handle exceptions locally within a controller, the _____ annotation can be used on a method within a @Controller or @RestController in Spring Boot.

  • @ExceptionHandler
  • @RequestMapping
  • @ResponseBody
  • @ResponseStatus
To handle exceptions locally within a controller in Spring Boot, you can use the @ExceptionHandler annotation on a method within a @Controller or @RestController. This annotation allows you to define methods that will handle specific exceptions thrown by the controller's methods.
Add your answer
Loading...

Leave a comment

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