Close
« Tutorial

Spring MVC - Validator Interface MCQ

0/13
0 ✓
0 ✗

1. What is the purpose of the Spring Validator interface?

2. Which two methods must a class implement when it implements the Spring Validator interface?

3. What is the job of the supports() method of a Validator?

4. What is the Errors object used for inside the validate() method?

5. What does ValidationUtils.rejectIfEmpty() do?

6. Which two values do you pass to the Errors.rejectValue() method?

7. How is an error code added by a Validator turned into a readable message for the user?

8. In a Spring MVC controller, how do you apply a custom Validator manually?

9. How can a controller check if validation found any errors?

10. What does a controller usually do when validation errors are found after a form submission?

11. The Spring Validator interface is an alternative to which kind of validation?

12. Which Spring form tag displays the validation error messages of a field in a JSP page?

13. The first parameter of the validate() method is of type Object. What should you do with it?

14. In which package is the Spring Validator interface found?

Join