We are currently in the process of refactoring our plugin API**(JDK 1.4 compliant)** which is shipped to our clients in the form of a jar file(ie, no need to have javascripts to be generated and so forth). This is a very lightweight plugin so that we have kept away as many dependent jars as possible like Spring. During this process we started to understand the need to have a proper validation methodology which is faciliated by some validation Framework. Strangly, I couldnt find much options in these lines (like other open source projects)apart from a few such as Commons Validator,Drools and Spring support.
Drools seems to be so complex for my needs. However Commons validator looks prehistoric in its style of validation.
I cannot use annotation based validation cause it has to be JDK 1.4 and would prefer something that could be externalized thereby not requiring to compile classes again in case of changes.
Are there better options available?
ValangValidator is a Spring-compatible validator that uses "valang" syntax such that if all you need is simple validations, you can just plug in a valang validator for your spring validator bean. ValangValidator also enables you to plug in your own custom function implementations. It is part of "springmodules".
See this link for more information.
We're using the VLAD framework from sapia, can be configured via XML and BeanShell.
If you prefer your validation rules in declarative style, you can try http://jvalidations.codehaus.org/
I've recently found the JValidations framework. It's plain Java, no XML. Using Hamcrest matchers. Validation code is placed in the validated object itself. Neat.
The XWork validation system was pretty decent back in the day but I haven't used it for almost 3 years now. I'm quite certain it was designed to be totally standalone but has also been rolled into Struts 2 along with the rest of WebWork. Info is here:
http://www.opensymphony.com/xwork/wikidocs/Validation%20Framework.html
Try Hibernate Validator. It's primarily directed at using annotations, but is perfectly usable without. I used it a few times, and liked its model.