To customize the response body of a global exception handler method in Spring Boot, the method should return an object of type _____.

  • CustomResponse
  • ExceptionResponse
  • ResponseEntity
  • ResponseObject
To customize the response body of a global exception handler method in Spring Boot, the method should return an object of type ResponseEntity. This allows you to create a custom response with specific status codes, headers, and response bodies when an exception is caught globally. It provides flexibility in crafting error responses tailored to your application's needs.
Add your answer
Loading...

Leave a comment

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