struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Law <>
Subject Re: Interceptor order
Date Thu, 20 May 2010 16:07:45 GMT

Cheers Chris,

Chris Pratt wrote:
> You may want to think about using:
> invocation.getStack().getContext().put(MAGIC_KEY,getStuff());
> instead of:
> invocation.getStack().set(MAGIC_KEY,getStuff());
> For the sake of argument, I'm going to assume that MAGIC_KEY is set to the
> String "magic".  The first example above makes #magic available in the
> Value
> Stack's context, so you can simply use <s:property
> value="%{#magic.gathering}"/> in your JSP to effectively give the same
> results as a call to getStuff().getGathering().  Whereas the second
> example
> changes the stack itself, which may be what's interfering with the other
> interceptors.

Is this documented anywhere? For the record, I would be looking for a great
big flashing Red sign saying "If you use the set() routine on the ValueStack
you'll silently blow away all the parameter handling code" for completeness
but I never found one of those yet.

Also for the record, using the set(MAGIC_KEY, this.getStuff()) call makes
'magic' available directly so I can reference it as <s:property
value="magic.gathering" />. I'm not clear in my mind how the alternative
version is better (other than your assertion that it will work :o}).


View this message in context:
Sent from the Struts - User mailing list archive at

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

View raw message