jsr-303

A better way to skip over javax.validation and org.hibernate compound-constraints

I have the following method that recursively breaks down a compound constraint into its component constraints: private void handleComposingConstraints(String friendlyName, Constraint parentConstraint, ConstraintDescriptor<? extends Annotation> parentDescriptor) { if(parentDescriptor.getAnnotation().annotationType().getName().indexO...

Spring MVC and JSR-303 hibernate conditional validation

I've a form I want to validate. It contains 2 Address variables. address1 has always to be validated, address2 has to be validated based on some conditions public class MyForm { String name; @Valid Address address1; Address address2; } public class Address { @NotEmpty private String street; } my controller aut...