I use the JSR303 Bean Validation to check the form input.
Code:
@NotBlank
@Size(min = 4, max = 30)
private String name;
@NotBlank
@Size(max = 100)
@Email
private String mail;
when then name and email is blankļ¼the @NotBlank, @Size at name, @NotBlank, @Size, @Email at mail will be checked.
I want set the check order, when the previous order is invalid, the next is not checked,
like below.
Code:
@NotBlank(order = 1)
@Size(min = 4, max = 30, order = 2)
private String name;
(but the above is not support by JSR303)
Is there a way to implement it for using JSR303?
(I think the custom annotation will done, but i don't like to add so much custom annotation for every property.)