R4RIN
Articles
Java 8
MCQS
Spring Boot MCQ Quiz Hub
Spring Boot - Exception Handling
Choose a topic to test your knowledge and improve your Spring Boot skills
1. Can we handle exceptions in Spring Boot?
Yes
No
2. Choose annotation, to handle the exceptions globally
@GlobalAdvice
@ControllerAdvice
Both
None
3. Choose annotation used to handle the specific exceptions and sending the custom responses to the client.
@GlobalAdvice
@ControllerAdvice
@ComponentScan
@ExceptionHandler
4. the code to create @ControllerAdvice class to handle the exceptions globally
import org.springframework.web.bind.annotation.@GlobalAdvice ; @ControllerAdvice public class ProductExceptionController { }
import org.springframework.web.bind.annotation.@@GlobalAdvice ; @GlobalAdice public class ProductExceptionController { }
import org.springframework.web.bind.annotation.ControllerAdvice; @ControllerAdvice public class ProductExceptionController { }
None
Submit