Return-Path: Delivered-To: apmail-jakarta-struts-dev-archive@apache.org Received: (qmail 47212 invoked from network); 12 Jul 2002 22:18:08 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jul 2002 22:18:08 -0000 Received: (qmail 24365 invoked by uid 97); 12 Jul 2002 22:18:22 -0000 Delivered-To: qmlist-jakarta-archive-struts-dev@jakarta.apache.org Received: (qmail 24349 invoked by uid 97); 12 Jul 2002 22:18:21 -0000 Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 24337 invoked by uid 98); 12 Jul 2002 22:18:20 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-Id: <5.1.0.14.2.20020712180810.037ee250@192.168.1.75> X-Sender: turner@192.168.1.75 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 12 Jul 2002 18:18:03 -0400 To: struts-dev@jakarta.apache.org From: James Turner Subject: Weirdness/possible bug in Validator dependencies Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Let's say I have two validations: Now, on the form, I leave gender blank and put garbage in for dateOfBirth. When the form validates, gender is given an error because it is blank, and dateOfBirth is not flagged at all. Why? Because in org.apache.commons.validator.Validator.validate(), hActionsRun is defined outside of the main loop. This means that if any field fails the "required" test, dateOfBirth will never run the "date" check because the required dependency fails, even though it's for another field. If you then put an entry in gender, required passes, and on the next form submission, you finally get your error for dateOfBirth. If hActionsRun were moved inside the loop, it would work correctly. However, it would mean that one field couldn't have a dependency that was defined by another, which I think is OK, since that's not supposed to be kosher as far as I can tell. Should I submit that as a patch against commons? James -- To unsubscribe, e-mail: For additional commands, e-mail: