Jason,

Either you misunderstood me... or I'm being incredibly thick (I'm leaning
towards the latter)...

But if 2 actions are

1) of the same class
2) and have the same action name
3) but reside in 2 different namespaces

then they'd *have to* have the same validation.

I don't see why you say they wouldn't.  The classnames would be identical,
naturally... and the validationContext would be identical too, since
validationContext = action name.

Now, admittedly... this may be an uncommon enough occurance for it not to be
a concern.  Heck, it may even be a desirable side effect.

But as I understood it, one of the big advantages to externalizing our
validation rules was the ability for the same action class to have different
'context-appropriate' validations.

And in such a scenario, it seems perfectly reasonable that you would
distinguish two such actions solely by namespace.

-Tim.





----- Original Message ----- 
From: "Jason Carreira" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 02, 2003 11:25 PM
Subject: RE: [OS-webwork] [XWork] Howto use validation framework with plain
JavaBeans (no Actions)


> No, because the validation files are named
>
> ClassName-validationContext-validation.xml
>
> Therefore the context is just a further specifier on top of the class
> name. All of the validations are class specific, with class defaults in
>
> ClassName-validation.xml
>
> And have more specific validations which are added to these defaults in
> the context specific files. You can also make the validation context for
> visitor validations be different from the context passed in from the
> outer Action by specifying a context param. I should probably make it
> where you can specify the context in the interceptor reference too...
> Hmm... Well, I've got to have something to add for 1.1 :-)
>
> Jason
>
> > -----Original Message-----
> > From: Tim Dwelle [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 02, 2003 10:54 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [OS-webwork] [XWork] Howto use validation
> > framework with plain JavaBeans (no Actions)
> >
> >
> > In the code snippet below, the context string = the action name.
> >
> > Doesn't that mean that if 2 actions (of the same class) have
> > the same name, but live in different namespaces, that they
> > have to use the same validation?
> >
> > Wouldn't it be better if the context string contained the
> > namespace as well?
> >
> >
> > -Tim.
> >
> >
> > ----- Original Message ----- 
> > From: "Jason Carreira" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 02, 2003 4:45 PM
> > Subject: RE: [OS-webwork] [XWork] Howto use validation
> > framework with plain JavaBeans (no Actions)
> >
> >
> > > Yep...
> > >
> > > Here's the before() method from the ValidationInterceptor:
> > >
> > >     protected void before(ActionInvocation invocation) throws
> > > Exception {
> > >         Action action = invocation.getAction();
> > >         String context = invocation.getProxy().getActionName();
> > >
> > >         if (log.isDebugEnabled()) {
> > >             log.debug("Validating " +
> > > invocation.getProxy().getNamespace() +
> > > invocation.getProxy().getActionName() + ".");
> > >         }
> > >
> > >         ActionValidatorManager.validate(action, context);
> > >     }
> > >
> > > There's nothing special about the action or the context here... It
> > > could be any bean and String context name.
> > >
> > > Jason
> > >
> > > > -----Original Message-----
> > > > From: Torsten Juergeleit [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, December 02, 2003 4:38 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [OS-webwork] [XWork] Howto use validation framework with
> > > > plain JavaBeans (no Actions)
> > > >
> > > >
> > > > Is XWork's validation framework usable with
> > > > non-actions (e.g. POJOs or JavaBeans) too?
> > > >
> > > > If yes, where can I find sample code?
> > > >
> > > > Cheers,
> > > > Torsten
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Free Pop-Up Blocker - Get it now http://companion.yahoo.com/
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by: SF.net Giveback Program.
> > > > Does SourceForge.net help you be more productive?  Does it
> > > > help you create better code?  SHARE THE LOVE, and help us
> > > > help YOU!  Click Here: http://sourceforge.net/donate/
> > > > _______________________________________________
> > > > Opensymphony-webwork mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: SF.net Giveback Program.
> > > Does SourceForge.net help you be more productive?  Does it
> > > help you create better code?  SHARE THE LOVE, and help us help
> > > YOU!  Click Here: http://sourceforge.net/donate/
> > > _______________________________________________
> > > Opensymphony-webwork mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > Does SourceForge.net help you be more productive?  Does it
> > help you create better code?  SHARE THE LOVE, and help us help
> > YOU!  Click Here: http://sourceforge.net/donate/
> > _______________________________________________
> > Opensymphony-webwork mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to