This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Similar Threads
Validate multiple fields base on a requiredif
Struts 1.1 validation help on Requiredif
Exception while loading the validation.xml in strusts
Struts Validation problem
custom validator and custom tags