Hi,

I just had a look at the code and tested it.
Unfortunately it does not work if you close the action tag as you thought
Rickard.
When the Action tag end is reached it calls the dispatcher finalizeContext
method which creates a new ActionContext object and sets it. The lookup
table from any previous context is then put into the new context.
But if you do not have a previous context (like in this model-1 example), it
is of course empty.

Wouldn't it be nice if in a web environment the stuff that is consistent
during the request, would remain in the ActionContext? Perhaps it could be
solved by adding another lookup table in the ActionContext for those
"long-lived" objects (request, response, servletcontext, session...). In the
finalizeContext method that map would just be transferred to the new
ActionContext created.
The "long-lived" lookup table would still be set whenever an action is
dispatched from ServletDispatcher or from an Action tag etc, so that no old
data would be lingering in the context.
Just a thought....

Cheers,

Dick

[EMAIL PROTECTED]


----- Original Message -----
From: "Rickard Öberg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 2:41 PM
Subject: Re: [OS-webwork] ActionContext clarification


> Dick Zetterberg wrote:
> > Isn't it possible to get a problem even if you do all your work in
actions,
> > for example if you are doing some Model-1 coding? For example if you
have an
> > action that you call many methods on, in a page like:
> > <ww:action name="'MyAction'" id="theAction"/>
> >
> > Later on in the page you decide to get some property from it:
> > <ww:property value="@theAction/someMethod"/>
> >
> > If that method "getSomeMethod" would try to access the session in the
> > ActionContext it would not find one, isn't that so?
> > So for that to work you would have to end the action tag at the bottom
of
> > the page instead, right?
>
> It would work since the context is set on a per thread basis, i.e. the
> association that is done when the <action> tag is run is still in place.
>
> AFAIK.
>
> /Rickard
>




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to