Input validation is a functionality that is common to all kinds of Java applications. It is an especially difficult task in case of web applications that take a lot of input from the user.
Writing and testing all validations in an application can become a humongous task and yet your application will remain bug prone. Your best bet is to instead opt for a framework that is widely used, well tested and makes your validations simple and systematic.
Enter the Commons Validator framework, our developer software pick for the week.
Validator provides :
- A configurable validation engine: Manage an XML configuration file and the validations in your entire application will take care of themselves.
- Out-of-the-box validations for most common requirements.
Validator works especially well with the Struts framework but it can also be used without Struts. Only a couple of days back, Validator 1.2.0 was released. Have a look at the ValidatorFaq as well changes in version 1.2.0.