struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <>
Subject Re: s:action tag major issues: threadlocals
Date Wed, 23 Apr 2008 03:55:57 GMT
Dave Newton wrote:
> My naïve reaction would be to put it on a stack, since we're talking nested
> contexts, and set the thread local from it. But I can't even find that code
> right now :/
> Dave
Yeah, that seems a major change to xwork.  By use of threadlocals it 
appears it was not intended to have nested invocations.

The tag itself creates a new sub-context and does attempt to preserve 
and restore the state:

// get the old value stack from the request
ValueStack stack = getStack();
try {
} finally {
// set the old stack back on the request
    req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);

It's just the threadlocals that aren't restored.  I suppose the tag 
could duplicate and restore the threadlocal actionContext, but it can't 
know what other threadlocals were modified by the invocation.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message