Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Spring MVC

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Which annotation is used to validate a form object in the controller methods?

a)

@Validate

b)

@Valid

c)

@Validation

d)

All of the above

2.

Which interface contains the results of the validation performed on the form object?

a)

BindingResponse

b)

ValidationResult

c)

BindingResult

d)

ValidationResponse

3.

Which form tag is used to display the error message in the jsp when a field fails validation?

a)

form:errors

b)

form:invalid

c)

form:valid

d)

form:input

4.

The shown method allows us to validate the form object myForm.

a)

True

b)

False

5.

Which one among these validator annotations is NOT a default or out-of-the-box hibernate?

a)

@Pattern

b)

@Email

c)

@Region

d)

@NotEmpty

6.

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?

a)

@NotNull

b)

@Pattern

c)

@Size

d)

@Digits

7.

What is the name of the interface implemented by a custom validator class?

a)

Validator

b)

ConstraintValidator

c)

MasterConstraintInterface

d)

CustomValidator

8.

Which of the following combinations are used to map a class to a database table?

a)

@Entity, @Table

b)

@Database, @Table

c)

@Database, @Entity, @Table

d)

@DB, @Table

9.

@Id annotation is used to map a field to a table’s primary key (PK).

a)

True

b)

False

10.

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.

a)

True

b)

False