struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: Customizing validation
Date Tue, 29 Nov 2011 02:00:36 GMT
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" <liying.cn.2010@gmail.com> 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 <davelnewton@gmail.com>:
> > 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message