Actions are wrapped with interceptors and these configuration we kept it in struts.xml
Instead of controlling it at configuration level, I want to bypass the execution of Action/next interceptors in the stack from interceptor itself.. dynamically .. is it really possible ?
Let me explain my problem in detail here..
I need to check a cookie at interceptor and need to execute different actions based on cookie value.. I tried in below way, I am able to redirect the response to desired action and page but with exceptions. Here is the code ..
java.lang.IllegalStateException: Cannot create a session after the response has been committed
But I dont want to execute the Action, instead I want to redirect/forward to some other action from interceptor. if I choose PreResultListener then it will be called before the result is being executed. ie after execution of your Action. I dont want to happen in my case. Please let me know if any thoughts
Did you try it by using a normal S2 result rather than doing a sendRedirect? That's a better solution anyway.
I'm pretty sure you don't want a forward anyway, since that'd show the original URL in the browser bar.
Joined: Jan 04, 2005
I may require to forward the request because I need to resend the same parameters that I received as part of request. That is a different problem again ;)
Can you suggest me how to redirect to S2 Action instead of response.sendRedirect() from Interceptor ?