JValidate validation library

What is JValidate?

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.

Why do we need JValidate

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.

What are the goals of JValidate

With JValidate we tried to create a generic validation engine, which requires no coupling to validation code in the javabeans itself.

  • Define in a simple way your basic validation rules.
  • Make it possible to define once and only once these rules.
  • Make it possible to use these rules throughout the application.
  • Integrate it with the used most common used webframeworks.

Other design goals of JValidate are

  • simplicity
  • consistency
  • ease of use

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!

How to use this framework

Step 1

Define your validation rules, this can be done with xdoclet-tags and/or programmaticaly.

Step 2

Validate your beans in the service layer.

Step 3

Propagate the validation message's back to the front-end, by using the webframework specific classes like components etc.