I can’t find an @Equal constraint in Play! 2.
I looked through the API
http://www.playframework.org/documentation/api/2.0.2/java/index.html
I want to have a SignupForm that checks if the passwords are equal. I don’t believe that I have to write my own constraint for such a common problem.
Something like:
...
@Min(6)
public String password;
@Equal(password)
public String confirmPassword;
...
I don’t any
@Equalcontraint in other Java framework neither in the JSR 303.To check for password, it’s not difficult: in your form object, just write a
public String validate()method:Take a look at the zentask sample, in this class.