Example,
I have
@NotEmpty //tells you 'may not be empty' if the field is empty
@Length(min = 2, max = 35) //tells you 'length must be between 2 and 35' if the field is less than 2 or greater than 35
private String firstName;
Then I input an empty value.
It says, ‘may not be empty
length must be between 2 and 35’
Is it possible to tell spring to validate one at a time per field?
Yes it is possible. Just create your own annotation like this:
important part is the @ReportAsSingleViolation annotation