You have a point.  However, the "required" check fails on all "null" and
"blank" (all whitespace) values.  Considering this, I felt this was a
"bug", because the "requiredIf" deviated from this convention.

Brad Handy


-------------------------------------------------
Bradley M. Handy                | Office: 517 750 6675
Programmer/Analyst      | Email: [EMAIL PROTECTED]
Spring Arbor University |
-------------------------------------------------
Sun Certified Programmer for the Java 2 Platform
-------------------------------------------------

-----Original Message-----
From: Kruse, Matt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 03, 2003 12:03 PM
To: Struts Users Mailing List
Subject: [struts-user] RE: Possible Bug in
FieldChecks.validateRequiredIf(...)

> Am I correct in assuming that the following condition 
> "((value != null) && (value.length() > 0))" should be
> "(!GenericValidator.isBlankOrNull(value))".  The reason my check is
> failing is due to the fact the value I'm checking is all 
> white space (at certain times), and is selected from 
> a select box.

I disagree with your assumption that "     " should fail a "required"
check.
In some situations, that may be a valid value to be submitted. It
exists,
and it has a value. A validation check for the field being required
should
pass.

It sounds like what you want is a "not blank" validation, where a value
consisting of all whitespaces, tabs, or newlines would fail.

I think the two are not the same, but that's just my opinion :)

Matt Kruse


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to