Ch13: Model Validation Flashcards

1
Q

Define validation

A

Process of checking data conforms to criteria to insure only meaningful data is stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Client-side or Server-side: Validation occurring in browser using JavaScript or HTML

A

Client-side Validation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Client-side or Server-side: Validation occurring on web server, utilizing Java

A

Server-side Validation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The ____ is responsible for defining validation rules, while the ____ is responsible for checking validation rules when data is submitted to the server

A

Model, controller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why should you validate all data submitted by users?

A
  • Data remains well structured

- Avoid unexpected errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Is both client-side and server-side validation required?

A

Yes, client-side validation can be bypassed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Use of javax.validation.constraints package?

A

Provides annotations useful for validating model fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Annotation that specifies minimum and/or maximum length for a string.

A

@Size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Annotation that specifies the minimum value of a numeric field

A

@Min

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Annotation that specifies the max value of a numeric field

A

@Max

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Annotation that specifies that a string field should conform to email formatting standards.

A

@Email

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Annotation that specifies that a field may not be null.

A

@NotNull

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Annotation that specifies that a string field contains at least one non-whitespace character.

A

@NotBlank

How well did you know this?
1
Not at all
2
3
4
5
Perfectly