WorksheetsSpring MVC
Total questions: 10
Worksheet time: 6mins
Which annotation is used to validate a form object in the controller methods?
@Validate
@Valid
@Validation
All of the above
Which interface contains the results of the validation performed on the form object?
BindingResponse
ValidationResult
BindingResult
ValidationResponse
Which form tag is used to display the error message in the jsp when a field fails validation?
form:errors
form:invalid
form:valid
form:input
The shown method allows us to validate the form object myForm.
True
False
Which one among these validator annotations is NOT a default or out-of-the-box hibernate?
@Pattern
@Region
@NotEmpty
If the user wants a required field that can only accept alphanumeric characters with a fixed length of 10, which of the following will not be of use?
@NotNull
@Pattern
@Size
@Digits
What is the name of the interface implemented by a custom validator class?
Validator
ConstraintValidator
MasterConstraintInterface
CustomValidator
Which of the following combinations are used to map a class to a database table?
@Entity, @Table
@Database, @Table
@Database, @Entity, @Table
@DB, @Table
@Id annotation is used to map a field to a table’s primary key (PK).
True
False
When using the @Column(name=””) annotation to map a field to a table’s column, the table column name in the database must match the field name in the entity exactly.
True
False
