How do you implement cross-field validation (e.g., confirming a password matches) using Bean Validation?
-
A
Use @ScriptAssert on the class and write a script comparing the fields
-
B
Create a class-level constraint annotation and implement a ConstraintValidator for the whole object
-
C
Annotate one field with @MatchField(other="fieldName")
-
D
Both A and B are valid approaches