Ask for an answer about AbstractNamedValueMethodArgumentResolver
I submitted a question on stack flow, I hope someone can help me solve my doubts, why should I let go of the empty string check,thank
Comment From: MentosL
My question is why the empty string can pass the required check. If I don’t want the empty string to pass the check, how should I configure it in the annotation?
Comment From: mdeinum
An empty string means the attribute is there but has no value, the required
here means that it has to be present. It doesn't mean it has to have a value, those are 2 different things. If you want a non empty value add an @NotEmpty
or @NotBlank
for the validation.