Open sanrodari opened 10 years ago
I think @Joined annotation is what you need. This validation is missing in our description, so I will fix that.
Thanks!
It's been a year and you haven't posted update. I think it's about time to do that. :)
+1
I can't figure out how to actually use @Joined
. How to get the second input in the IValidator
?
Okay, I got it. I didn't know it's a IValidator<String[]>:
public class NotEqualCrossValidator extends BaseValidator<String[]> {
@Override
public boolean validate(Annotation annotation, String[] input) {
return !input[0].equals(input[1]);
}
}
I need to validate a password confirmation but on
I only have access to the value of the field itself and there is no way to access the password field.
I hacked the library in this nasty way: