File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Apache Commons Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Apache Commons Validation" Watch "Apache Commons Validation" New topic

Apache Commons Validation

Ravi Shankar Mukkavilli

Joined: Feb 10, 2009
Posts: 12
Hello all,

I'm using apache commons validation for validating my form.I have this case for which I'm not able to define the rule. I have 4 fields in the form, and the user has to fill in at least one before hitting the submit. How can I validate this?

Also I have a validation something like this in my validation.xml file

As you can see reworkHours depends on the reworked to be NOTNULL, actually I want the reworked field should have a "valid" value before validating the reworkHours field. So can I replace "NOTNULL" in the
<var-value>NOTNULL</var-value> with something which will in fact validate for say as an Integer instead of just NOTNULL.

Any help in the above two question would be really helpful.



SCJP 1.4
David Newton

Joined: Sep 29, 2008
Posts: 12617

Isn't there an expression validator?
I agree. Here's the link:
subject: Apache Commons Validation
It's not a secret anymore!