Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 5309 invoked from network); 18 Nov 2009 05:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Nov 2009 05:04:04 -0000 Received: (qmail 3752 invoked by uid 500); 18 Nov 2009 05:04:04 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 3521 invoked by uid 500); 18 Nov 2009 05:04:02 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 3511 invoked by uid 99); 18 Nov 2009 05:04:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2009 05:04:02 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Nov 2009 05:03:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8D7A7234C052 for ; Tue, 17 Nov 2009 21:03:39 -0800 (PST) Message-ID: <1843914096.1258520619571.JavaMail.jira@brutus> Date: Wed, 18 Nov 2009 05:03:39 +0000 (UTC) From: "Lorenzo Dee (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (VALIDATOR-281) Indexed property validation stops on first failed element In-Reply-To: <1038968697.1258520019608.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/VALIDATOR-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lorenzo Dee updated VALIDATOR-281: ---------------------------------- Attachment: Field.java Here's a simple fix I did. I just modified line 912 (Field.java). Instead of returning, I changed it to break out of the while-loop to continue validating the next element of the indexed list property. > Indexed property validation stops on first failed element > --------------------------------------------------------- > > Key: VALIDATOR-281 > URL: https://issues.apache.org/jira/browse/VALIDATOR-281 > Project: Commons Validator > Issue Type: Improvement > Components: Framework > Affects Versions: 1.1.4 Release > Reporter: Lorenzo Dee > Priority: Trivial > Attachments: Field.java > > > I'm using Struts 1.2.9 and its validator framework. The validation of an indexed property stops on the first element that fails vaildation. For example, the following list of postal addresses is being validated: > addr[0].city > addr[0].state > addr[0].zip > addr[1].city > addr[1].state > addr[1].zip > addr[2].city > addr[2].state > addr[2].zip > My validation.xml contains something like: >
> > . . . > >
> When validating the city fields, it would go from addresses[0].city upto addresses[2].city. But when validation fails at addr[0].city, the rest is not being validated anymore (i.e. addr[1].city and addr[2].city are not validated). It would be better if addr[1].city and addr[2].city fields are validated, even if one of them fails. > Note that this behavior also affects state and zip fields. Say for example, if addr[1].state fails validation, it will no longer continue to validate addr[2].state. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.