views:

1381

answers:

6

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?

+1  A: 

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

cliff.meyers
A: 

Have you tried iScreen? Its pretty good (much better than commons validator).

Since the last time i checked, iScreen was JDK 1.5.
Franklin
oops, we had used it in 1.5. However, I guess if you use iScreen with ognl, you don't need 1.5. Check http://www.i-screen.org/docs/Dependencies.html.
A: 

We're using the VLAD framework from sapia, can be configured via XML and BeanShell.

boutta
A: 

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.

Paul
A: 

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 customn funtion implementations. It is part of "springmodules".

See this link for more information.

MetroidFan2002
A: 

If you prefer your validation rules in declarative style, you can try http://jvalidations.codehaus.org/