Sorry, my answer was a little misleading, too :-)

Yes, what I meant by the example code was just to show how the
ValidationManager can be called. It doesn't have to be from the
Interceptor.

In fact, we use this at work for validating document entry and batch
processing from large XML files -> Java data objects -> database.

Jason

> -----Original Message-----
> From: Torsten Juergeleit [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 03, 2003 4:10 AM
> To: [EMAIL PROTECTED]
> Subject: [OS-webwork] RE: RE: [XWork] Howto use validation 
> framework with plain JavaBeans (no Actions)
> 
> 
> Hi Jason,
> 
> thank your for your fast answer. But my question was a
> little bit misleading :-(
> 
> We are looking for a generic validation technique for 
> ValueObjects/Data Transfer Objects handled by a multi-client 
> business tier.
> 
> Can we use XWork's validation framework to validate
> these ValueObjects (POJOs / JavaBeans) WITHOUT
> applying the command pattern on them [putting them in
> a related  Action, calling Action.execute(),
> interceptor performs the validation,...]?
> 
> Something like
> "ValidationManager.validate(MyValueObject)"...
> 
> Cheers,
> Torsten
> 
> >Yep...=20
> >
> >Here's the before() method from the
> >ValidationInterceptor:
> 
> >    protected void before(ActionInvocation
> invocation) throws Exception
> >{
> >        Action action =3D invocation.getAction();
> >        String context =3D
> 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=20
> >> with plain JavaBeans (no Actions)
> >>=20
> >>=20
> >> Is XWork's validation framework usable with
> >> non-actions (e.g. POJOs or JavaBeans) too?
> >>=20
> >> If yes, where can I find sample code?
> >>=20
> >> 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

Reply via email to