Close
« Tutorial

Spring MVC - Form Tag Library and Validation Errors MCQ

0/13
0 ✓
0 ✗

1. What is the main purpose of the Spring form tag library in JSP pages?

2. Which JSP directive is needed at the top of a page to use the Spring form tags?

3. Which attribute of the Spring form tag gives the name of the model attribute that holds the form object?

<form:form action="register" method="post" ______="user">
  ...
</form:form>

4. What is the path attribute of tags like input and errors used for?

5. Which Spring form tag displays the validation error messages of a field?

6. A form uses modelAttribute="user". What must the controller do before showing this form for the first time?

7. Which annotation connects a handler method parameter to the modelAttribute name used in the form tag?

8. What does the errors tag render when a field has a validation error?

9. What does the errors tag render when the field has no validation errors?

10. Which attribute of the errors tag applies a CSS class to the error message?

11. Why are Spring form tags useful for validation compared to plain HTML form elements?

12. When using @Valid on a handler parameter, which parameter type must come right after it to receive the validation results?

13. When validation fails, what does a handler method usually do so the user can see the errors?

14. By default, what value does the Spring password tag render when the form is shown again after a validation error?

15. What does the Spring input tag with path="name" render in HTML?

Join