Thursday, December 15, 2011

JSR 303 Validation Question

I don't know if anybody has asked this before, but I can't find it on google.  I have a class with two fields (username,email) and need to validate that the email starts with the username.  Can I do something like this?

private String username;
@Pattern(regex="^${username}.*$")

I'm guessing not.

No comments: