🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.400 Bad Request
  2. B.The rule is not checked and the empty title is accepted
  3. C.The app fails to start
  4. 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 →