Using Hibernate Validator to cover your validation needs

Recently I had to choose a validation framework or write one by my own. First I thought, no big deal, validation is not that a complicated issue. But the more you think of it, the more you come to the conclusion it is not as shallow as you think – you need to validate different types, you have different groups and much more issues… In short, writing a validation framework by yourself demands a lot of work. Luckily, JSR 303 comes to solve exactly that and the hibernate implementation of this JSR does a pretty good job. Hibernate Validator is a JSR 303 implementation for bean validation. The way to work with this framework is first, to define constraints for a java bean fields, and then, validating the bean. JSR 303 JSR 303 – defines a metadata model and API for entity validation. The default metadata source is annotations, with the ability to override and extend the meta-data through the use of XML. The API is not tied to a specific application tier or programming model. It is specifically not tied to either the web tier or the persistence tier, and is available for both server-side application programming, as well Continue reading Using Hibernate Validator to cover your validation needs