JValidate is a powerful, extensible library to validate javabeans. It uses Java annotations or XDoclet-tags to define the basic rules for javabean properties. Examples a maximum lengths for strings, minumum an maximum size for numbers, etc. It provides a validation engine to validate the javabeans, based on the declared rules and additional rules. These additional rules that can be provided in other ways. Furthermore it provides, web-framework specific classes and components to show validation messages in the user interface.
JValidate solves a problem that many (web) developers faces. We want to define our validation once and only once, and by preference not in the UI and independent of whatever validation mechanism the web-framework is using.
With JValidate we tried to create a generic validation engine, which requires no coupling to validation code in the javabeans itself.
Other design goals of JValidate are
We strived for simplicity and ease of use for the developer in defining the basic validation rules. Consistency in defining these rules once and only once and consistency in the mechanism used to validate and show validation messages.
Try JValidate yourself to see if we succeeded in accomplishing these goals!
Define your validation rules, this can be done with xdoclet-tags and/or programmaticaly.
Validate your beans in the service layer.
Propagate the validation message's back to the front-end, by using the webframework specific classes like components etc.