I use JSR303 Spring Validation
and I have the following;
@Digits(fraction = 0, integer = 15)
private String tpMobile;
Validation says Must be number between 10-15 digits
, but the thing is this field is optional. So when user left it empty also the same error message shows.
So what I want to do is validate only if the field is not empty. If the field is empty skip validating that field