The problem with not cleaning up the ActionContext is that cleaning it
up at the end of the ActionProxy lifecycle is the only good way we have
to ensure that the ThreadLocal is cleaned up... Otherwise it might stick
to the Thread and be there for the next call, which would be BAD.

I'm not sure what the best other solution is... They all kind of sound
bad to me. Thoughts anyone?

Jason

> -----Original Message-----
> From: Dick Zetterberg [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 10, 2003 5:36 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] How ActionTag in WW2 work?
> 
> 
> I do not think the methods in BaseActionSupport should be 
> changed to load the locale earlier. That was only an example 
> of a method depending on the ActionContext. There might be 
> other occasions when you need the context in a method that 
> You have created. Keeping a reference to the context will 
> help a bit (I do that in my own support class). You might 
> still run into problems though if you for example decide to 
> call a static method like LocalizedTextUtil.findDefaultText 
> without realizing that it is actually depending on the ActionContext.
> 
> I think the best solution would be if one could be sure that 
> there always existed an ActionContext if one had used an 
> action tag in a JSP page. 
> Perhaps if the action tag would check if the old saved 
> context was an "empty" context, or a context not belonging to 
> the current request,  then it would not clean-up the context 
> it just created. Another solution would be to add a new 
> context tag that one could use just to create a context. Or 
> one could create an optional action execute tag so the 
> execution could be triggered by that, and the action context 
> clean up would remain in the action end tag (which one could 
> then put at the end of the JSP page just like in WW1.x). If 
> one choose not to use execute then the execution would happen 
> in the end tag.
> 
> Best regards,
> 
> Dick Zetterberg
> [EMAIL PROTECTED]
> 
> 
> ----- Original Message ----- 
> From: "Pat Lightbody" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 08, 2003 2:11 AM
> Subject: Re: [OS-webwork] How ActionTag in WW2 work?
> 
> 
> > If there are methods, such as getLocale(), that call the 
> > ActionContext, maybe we should fix that by having BaseActionSupport 
> > load up the Locale before the getter is called? Or at least 
> have the 
> > current AC reference saved internally?
> > 
> > -Pat
> > 
> > ----- Original Message -----
> > From: "Dick Zetterberg" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, June 06, 2003 5:22 AM
> > Subject: Re: [OS-webwork] How ActionTag in WW2 work?
> > 
> > 
> > > There will be an ActionContext during the execution, yes, 
> but when 
> > > the
> > #foo.blah method is called there will be no ActionContext, right?
> > > So if I would for example call the  #foo.locale method (the 
> > > getLocale
> > method in BaseActionSupport) that method will try to access the 
> > ActionContext but it will not find the ActionContext that was used 
> > during the execution of the action. Imagine if I have a method that 
> > tries to use the ActionContext to do something with session data. 
> > Nothing will work as expected.
> > > I cannot seem to find the testSimple class so if I have 
> > > misunderstood
> > something, please correct me.
> > > The problem also exists in WW1 but there one can work 
> around it by 
> > > letting
> > the action tag span the page, as I described before. I see 
> no similar 
> > work-around now in WW2 which is the reason for me asking these 
> > questions.
> > >
> > > Best regards,
> > >
> > > Dick Zetterberg
> > > [EMAIL PROTECTED]
> > >
> > > ----- Original Message -----
> > > From: "Jason Carreira" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, June 06, 2003 12:57 PM
> > > Subject: RE: [OS-webwork] How ActionTag in WW2 work?
> > >
> > >
> > > > It should not be a problem. If you don't have an ActionContext 
> > > > before the tag, you won't have one after, but during 
> the execution 
> > > > of the Action it will have one (ActionContext's are 
> created in the 
> > > > creation of the ActionInvocation, which is created with the 
> > > > ActionProxy in the ActionTag). The executed Action is 
> put into the 
> > > > PageContext with the Id, which is how Patrick was accessing it 
> > > > with #foo.  The unit test testSimple doesn't create an 
> > > > ActionContext before executing the tag, which is the 
> same as what 
> > > > you're talking about.
> > > >
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by:  Etnus, makers of 
> TotalView, The best thread debugger on the planet. Designed 
> with thread debugging features you've never dreamed of, try 
> TotalView 6 free at www.etnus.com. 
> _______________________________________________
> Opensymphony-webwork mailing list 
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to