I have an object that represents the form and having applied validation to the fields by means of annotations. I have two questions in this regards:
- how to ensure value of a field matches that of another field, for example when ensuring the confirmation password matches the first
- how to only apply the validation on a field based on the state of another field or session value.
While I could do all of this within the controller or using a traditional validator, I want to see if it is possible via annotations.