I'm trying to use GWT's 2.5 in-build validation feature. I have a few complex validations. Cross field validation with Hibernate Validator (JSR 303) suggests that I could either include methods which do the validation OR write my own annotations. However, both don't work.
public class PageData extends Serializable
@NotNull(message="Cannot be null!")
Boolean value
@AssertTrue(message="isValid() is false!")
private boolean isValid() {
return false;
}
//Getters and Setters
}
Boolean value is validated. However, isValid() is never called/validated. But why? Is this a GWt specific problem?
Then I tried to write my own annotation, The @FieldMatch example in Cross field validation with Hibernate Validator (JSR 303) uses Beans.getProperty() from Apache Commons BeanUtils, which I cannot use in GWT. Is there any way to make these kind of complex annotations work in GWT?