To define a global default exception handler for unhandled exceptions in Spring Boot, you can use a _____ with the highest precedence.
- @ControllerAdvice
- @ExceptionHandler
- @ExceptionHandlerAdvice
- @ResponseStatus
In Spring Boot, to define a global default exception handler for unhandled exceptions, you use the @ControllerAdvice annotation. This annotation allows you to define a class that can be applied globally to handle exceptions across all controllers. It provides a way to centralize exception handling in your application.
Loading...
Related Quiz
- To ensure the security of passwords, Spring Security recommends using a _____ password encoder.
- How can you customize the token endpoint response of an OAuth2 Authorization Server in Spring Boot?
- To customize the storage and retrieval of cache in Spring Boot, a developer can implement the _____ interface.
- Which of the following is true regarding the @SpringBootTest annotation when testing Spring Boot applications?
- In Mockito, to ensure that a mocked method was called with specific arguments, you would use the _____ method.