struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20455] New: - Bug in FieldChecks.validateRequiredIf(...)
Date Tue, 03 Jun 2003 16:04:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20455>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20455

Bug in FieldChecks.validateRequiredIf(...)

           Summary: Bug in FieldChecks.validateRequiredIf(...)
           Product: Struts
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: bhandy@users.sf.net


I have a validation that should be failing (under certain conditions),
but is not.  I've double checked and triple checked to make sure the
setup is correct, and it's still not working correctly.

So, I took a look at the code for "validateRequiredIf" in 
the "org.apache.struts.validator.FieldChecks" class.  At the end of
the method I found this segment of code:

if (required) {
    if ((value != null) && (value.length() > 0)) {
        return true;
    } else {
        errors.add(field.getKey(), Resources.getActionError(request, va, 
field));
        return false;
    }
}

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.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message