← Quiz: Validation and Errors: all 10 questions
Quiz: Validation and Errors · Question 1 of 10
The DTO has @NotBlank on title but the controller parameter lacks @Valid. What happens with an empty title?
The DTO has @NotBlank on title but the controller parameter lacks @Valid. What happens with an empty title?
- A.400 Bad Request
- B.The rule is not checked and the empty title is accepted
- C.The app fails to start
- D.A 500 error
Answer & explanation
Correct answer: The rule is not checked and the empty title is accepted
Validation runs only when @Valid (or @Validated) triggers it.
Can you get the rest right without peeking?
Take the timed Quiz: Validation and Errors quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →