You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2010/11/12 09:20:13 UTC
[jira] Commented: (WICKET-3161) Can not create cookies
[ https://issues.apache.org/jira/browse/WICKET-3161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931345#action_12931345 ]
Martin Grigorov commented on WICKET-3161:
-----------------------------------------
Hi Ivaylo,
Which render strategy do you use in your application ? (do you use getRequestCycleSettings().setRenderStragegy())
The purpose of the Action's is to cache the actual behavior for the response after the redirect. I.e. you set a cookie to the response, at the end of the request cycle this response is saved in org.apache.wicket.protocol.http.WebApplication.storeBufferedResponse(String, Url, BufferedWebResponse), then a redirect (without the cookie) is being made, and when the redirect comes back org.apache.wicket.request.mapper.BufferedResponseMapper.hasBufferedResponse(Url) will see there is a cached response and will use it without re-doing the whole request cycle processing, and now the cookie action will be executed.
This code has been changed between 1.5-M2.1 and M3 so it indeed could be broken.
Can you create a quickstart application so we can debug it more easily ?
Thanks!
> Can not create cookies
> ----------------------
>
> Key: WICKET-3161
> URL: https://issues.apache.org/jira/browse/WICKET-3161
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5-M3
> Environment: Windows 7, Intel i7
> Reporter: Ivaylo Stoykov
>
> Hi,
> I'm migrating to wicket 1.5-M3 and I've encountered a problem. I can not create cookies (I presume that I can't delete them either).
> I've looked through the source code and this is what I found:
> I add the cookie to the response and I end up with a nice HeaderBufferingWebResponse which contains BufferedWebResponse$AddCookieAction.
> But then redirectTo(Url, RequestCycle) from WebPageRenderer class is called. Here is the method:
>
> private void redirectTo(Url url, RequestCycle requestCycle)
> {
> WebResponse response = (WebResponse)requestCycle.getResponse();
> String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url);
> response.reset();
> response.sendRedirect(relativeUrl);
> }
> response.reset(); - removes all actions from the request.
> So after this method my request has got only BufferedWebResponse$SendRedirectAction.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.