In Spring Boot, a custom error response can be returned from an exception handler by returning an instance of _____.
- Exception
- Model
- ModelAndView
- ResponseEntity
In Spring Boot, when you want to return a custom error response from an exception handler, you can do so by returning an instance of ResponseEntity. This allows you to customize the HTTP status code, headers, and response body to provide detailed error information.
Loading...
Related Quiz
- In Spring Boot, which framework is primarily used for mocking objects in unit tests?
- In Spring Security, the method loadUserByUsername is defined in the _____ interface.
- How can you create a custom query method in a Spring Data JPA repository?
- What components are typically scanned and loaded when a test is annotated with @DataJpaTest in Spring Boot?
- When performing integration testing in Spring Boot, the _____ utility class is used to perform HTTP requests and receive responses.