Post subject: Validation annotations should be able to reference fields

Posted: Wed May 04, 2011 4:09 pm

Newbie

Joined: Wed May 04, 2011 3:50 pmPosts: 1

There are several typical cases for this including: Verifying a password, checking validity of a date range, etc. There are several proposed solutions, but they all involve either a large amount of code, or are not repeatable. For example: http://stackoverflow.com/questions/1972 ... or-jsr-303

Rather than having to build annotations on top of the class, I would love support for something like:

public class SignupForm{

@NotNull String password;

@NotNull @Confirms(confirm="password") String passwordConfirmation;}

Weather as a builtin, or given the ability to construct our own - this would be extremely handy!