Andy Law wrote:
> 
> <p>Following on from my previous question
> (http://old.nabble.com/Some-Spring-Struts-questions-td28533505.html) about
> injecting objects orthogonal to actions into the environment where jsps
> can "see" them, I now have an interceptor that does what I want it do
> (Yay! - thanks guys).
> </p><p>
> However, I'm seeing some peculiar behaviour that I don't understand fully.
> </p><p>
> The pertinent code in the interceptor is reproduced below. It does what I
> expect it to do insofar as it sticks my "Stuff" object in a place that the
> JSP can retrieve it using the MAGIC_KEY string. However, if I configure my
> interceptor stack with this interceptor at the top, none of the other
> interceptors appear to fire. If I put this interceptor last in the stack,
> all of the others do seem to fire (well, the application works). Why
> should I need to put this after all the params-prepare-params stuff?
> </p><p>
> <pre>
> <code>
>     public String intercept(ActionInvocation invocation) throws
>             Exception {
> 
>         if (this.getStuff() != null) {
>             ActionContext ic = invocation.getInvocationContext();
>             if (ic != null) {
>                 ValueStack vs = ic.getValueStack();
>                 if (vs != null) {
>                     vs.set(MAGIC_KEY, this.getStuff());
>                 }
>             }
>         }
>         return invocation.invoke();
>     }
> </code>
> </pre>
> </p>
> <p>As always, any and all help/pointers gratefully accepted, particularly
> if I'm doing something stupid!</p>
> <p>Later</p>
> <p>Andy</p>
> 
> 

First of all, I'd load the config-browser plugin and check that the
interceptor stack your action is using is actually the stack that you think
it is. (BTDTGTTS)

Secondly, I've never tried to poke the ValueStack directly, I've always used
Interceptors to load objects into my actions and then retrieved them from
there with the standard struts tags. What happens if you take all your
processing out leaving just "return invocation.invoke()" - does your stack
still fire?

Regards
-- 
View this message in context: 
http://old.nabble.com/Interceptor-order-tp28597967p28607337.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to