Please create a Jira on this for post xwork 1.0 and I'll take a look. I don't remember 
the details of the internals off the top of my head...

> -----Original Message-----
> From: Vincent Tenc� [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 12, 2003 11:55 AM
> To: [EMAIL PROTECTED]; 
> [EMAIL PROTECTED]
> Subject: RE: [picocontainer-dev] Interceptors Instantiation
> 
> 
> Thanks for the great news Jason. We're looking forward to that!
> 
> XWork and Pico together is a real winning combination. 
> Currently, there is an issue with the Pico integration and 
> I'd like to leverage your expertise on XWork.
> 
> Pico-extras defines a sub-class of DefaultActionInvocation 
> that overrides the protected createAction() method. At that 
> point it needs to retrieve the HttpServletRequest but the 
> value stack is not ready (getStack() returns null). My 
> understanding is that the servlet request will either be in 
> the extraContext or in the context of the value stack (in 
> case we are chaining actions). I am also assuming that the 
> extraContext is never null. Are those assumptions right? If 
> this is correct, I propose to get a hold on the request like this:
> 
> public class PicoActionInvocation extends 
> DefaultActionInvocation implements KeyConstants {
> 
> <snip/>
> 
>     private HttpServletRequest getServletRequest() {
>         // First look for request in the extraContext
>         HttpServletRequest request = (HttpServletRequest) 
> extraContext.get(WebWorkStatics.HTTP_REQUEST);
> 
>         if (request == null) {
>             // It must be in the value stack
>             OgnlValueStack stack = (OgnlValueStack) 
> extraContext.get(ActionContext.VALUE_STACK);
>             request = (HttpServletRequest) 
> stack.getContext().get(WebWorkStatics.HTTP_REQUEST);
>         }
> 
>         return request;
>     }
> 
> <snip/>
> }
> 
> I am not so familiar with XWork internals so I'd really 
> appreciate your opinion on this. Another (preferred?) option 
> would be to modify DefaultActionInvocation init() method to 
> make sure that the value stack is properly created and 
> populated with the extraContext before createAction() is 
> called. Then after creation, the action could be pushed on 
> the stack. Thoughts?
> 
> Thanks,
> Vincent
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] 
> Behalf Of Jason 
> > Carreira
> > Sent: Friday, December 12, 2003 11:26 AM
> > To: [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: RE: [picocontainer-dev] Interceptors Instantiation
> >
> >
> > Interceptors are instantiated once per ActionConfig (per Action 
> > alias).
> >
> > I believe there's an InterceptorBuilder class (or something like
> > that) that Mike C-B refactored out of the original design. 
> Right now 
> > this is not pluggable. One of by big plans for Xwork 1.1 is to 
> > refactor ALL object instantiation (Actions, Interceptors, 
> etc) into a 
> > pluggable factory. This will allow Pico, Spring, etc to be used for 
> > instantiating and managing these objects as components.
> >
> > > -----Original Message-----
> > > From: Francois Beauregard [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, December 11, 2003 10:44 PM
> > > To: [EMAIL PROTECTED]
> > > Cc: [EMAIL PROTECTED]
> > > Subject: [picocontainer-dev] Interceptors Instantiation
> > >
> > >
> > > We are currently using Webwork2 - XWork with 
> PicoContainer. I must 
> > > say that this combination really rocks. For those who are using 
> > > other IOC containers (Spring and Avalon), have a look at 
> Pico it is 
> > > amazingly simple but makes your code sooo clean.
> > >
> > > The integration is well laid out (Great stuff by Joe 
> Walnes). Still 
> > > a few issues that we are currently working on but workable.
> > >
> > > Anyway, I should get to the real point of my post which 
> is : We are 
> > > looking at making interceptors pico component themselves 
> which would 
> > > allow to use pico's magic to get other components to be used from 
> > > interceptors. I am not familiar with XWork's code base. A 
> quick look 
> > > makes me think the interceptors are instantiated once for a given 
> > > action type. Am I right? Where this is done?
> > >
> > > If interceptors are instantiated once, this would limit us to the 
> > > components that are registered in the application scope pico 
> > > container but still would be very interesting.
> > >
> > > Cheers,
> > > Fran�ois
> > > ___________________________
> > > Fran�ois Beauregard, b.ing.
> > > Vice-pr�sident
> > > Recherche et d�veloppement
> > > Pyxis Technologies
> > > www.pyxis-tech.com
> > >
> > > T : (450) 681-9094, poste 102
> > > F : (450) 681-5758
> > > [EMAIL PROTECTED]
> > >
> > > _______________________________________________
> > > picocontainer-dev mailing list 
> [EMAIL PROTECTED]
> > > http://lists.codehaus.org/mailman/listinfo/picocontainer-dev
> > >
> > _______________________________________________
> > picocontainer-dev mailing list [EMAIL PROTECTED]
> > http://lists.codehaus.org/mailman/listinfo/picocontainer-dev
> >
> 
> _______________________________________________
> picocontainer-dev mailing list [EMAIL PROTECTED]
> http://lists.codehaus.org/mailman/listinfo/picocontainer-dev
> 


-------------------------------------------------------
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