Articles with tag "Spring"

Recipe: Using Hibernate event-based validation with custom JSR-303 validators and Spring autowired injection

JSR-303 (Bean Validation) is nice. It allows to define validation rules directly on beans using simple annotations. Most cases are covered by the base annotations provided by the standard, and it even includes a way to develop custom validators that can be plugged-in as you see fit. Once your beans are annotated, you can manually trigger validation as simply as: Set<ConstraintViolation> constraintViolations = validator.validate(annotatedBeanInstance); The latest and greatest Spring 3 now supports JSR-303 validation out of the box. Read more...