Using Cookies with Interceptors
"Greg Pelly" <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <[email protected]> |
I have an application that stores user information in Cookies. Up
until this point, these cookies have been created and added to the
response before my interceptor calls invocation.invoke(). I'd like to
change my Interceptor to store the cookie in the response after the
action invocation (the reason for this is so I can persist information
retrieved during the invocation). However, a simple test failed and
also seems to indicate that the response is committed to the user
before invocation.invoke() returns.
This works:
[code]
addCookie("foo","bar",ServletActionContext.getResponse());
String result = invocation.invoke();
[/code]
this doesn't work:
[code]
String result = invocation.invoke();
addCookie("foo","bar",ServletActionContext.getResponse());
[/code]
Furthermore, I've added a breakpoint to my addCookie() method to check
out what is going on. In the latter case above, when Eclipse halts at
my breakpoint, I can already see that the page has loaded in my
browser window, so there's no way I'll be sending cookies in the
headers at that point.
Does WW have a facility to hold off on sending the response until
after all the interceptors finish executing? My Google searches
didn't turn up many cases of people using Cookies & Interceptors
together.
Thanks,
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]