Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 786669DEC for ; Tue, 29 Nov 2011 02:01:06 +0000 (UTC) Received: (qmail 12552 invoked by uid 500); 29 Nov 2011 02:01:03 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 12523 invoked by uid 500); 29 Nov 2011 02:01:03 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 12515 invoked by uid 99); 29 Nov 2011 02:01:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2011 02:01:03 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of davelnewton@gmail.com designates 209.85.220.176 as permitted sender) Received: from [209.85.220.176] (HELO mail-vx0-f176.google.com) (209.85.220.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2011 02:00:57 +0000 Received: by vcbfl13 with SMTP id fl13so2206340vcb.35 for ; Mon, 28 Nov 2011 18:00:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=tHkf4IZMU9RHLbkmovF+pmzDS9zpOin6P8IEMBcnbq4=; b=a1UWXLLP8Haie/9mhcRdjksCc4m5gWpezLnLfArlmvDs8k7KtsB7fCebg6S2I3uhlo QzqYR4Wzjv2y6ljtf7x4lp5NtreIoSymyNsWArwy3KH8t7usO2R/OMBypn4CMswKirz1 g1JWF7AoNsyYbhA1T8tYR2JFvhM5Ghgr/G+A0= MIME-Version: 1.0 Received: by 10.52.183.36 with SMTP id ej4mr46981419vdc.26.1322532036281; Mon, 28 Nov 2011 18:00:36 -0800 (PST) Received: by 10.220.187.195 with HTTP; Mon, 28 Nov 2011 18:00:36 -0800 (PST) Received: by 10.220.187.195 with HTTP; Mon, 28 Nov 2011 18:00:36 -0800 (PST) In-Reply-To: References: Date: Mon, 28 Nov 2011 21:00:36 -0500 Message-ID: Subject: Re: Customizing validation From: Dave Newton To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=bcaec548a5f93a047504b2d5fce4 --bcaec548a5f93a047504b2d5fce4 Content-Type: text/plain; charset=ISO-8859-1 If the need is across the application, then modifying the app-wide interceptor makes sense. App-wide rule-based validations require something higher-level than reworking existing validators, or writing new ones, to express something that is likely declarative in nature. Seems more like "run this bunch of validations based on this condition"--rather than simply look up validations based on the action name, lookup should be based on the condition(s). That's mechanism-level, not validate-level. d. On Nov 28, 2011 8:33 PM, "Li Ying" wrote: > Changing the [validation interceptor] will switch on/off the all > validations by one pre-condition. > > But what he need is: > if and only if pre-condition-A is true, run validation-A; > if and only if pre-condition-B is true, run validation-B; > etc... > > So, I think the right way is, change the validators. > > > > 2011/11/29 Dave Newton : > > If the goal is to execute validations based on arbitrary preconditions (I > > missed the original req) the *easiest* thing to do might be to just > > extend/usurp the existing validation interceptor to do that precondition > > check. > > > > d. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --bcaec548a5f93a047504b2d5fce4--