[ 
https://issues.apache.org/jira/browse/WICKET-5369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Grigorov resolved WICKET-5369.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.12.0
                   7.0.0

>From now on it will be WebResponse.
                
> Can't set a cookie using CookieUtils during an ajax request due to 
> java.lang.ClassCastException: 
> org.apache.wicket.ajax.AbstractAjaxResponse$AjaxResponse cannot be cast to 
> org.apache.wicket.request.http.WebResponse
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5369
>                 URL: https://issues.apache.org/jira/browse/WICKET-5369
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 6.9.1
>         Environment: Java 7, Servlet 2.5, Apache Tomcat 7.
>            Reporter: David Gileadi
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 7.0.0, 6.12.0
>
>
> I have a subclass of 
> org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable whose 
> IDataProvider.iterator method indirectly calls CookieUtils.save. This causes 
> the following stack trace:
> Caused by: java.lang.ClassCastException: 
> org.apache.wicket.ajax.AbstractAjaxResponse$AjaxResponse cannot be cast to 
> org.apache.wicket.request.http.WebResponse
>       at 
> org.apache.wicket.util.cookies.CookieUtils.getWebResponse(CookieUtils.java:354)
>  ~[wicket-core-6.9.1.jar:6.9.1]
>       at 
> org.apache.wicket.util.cookies.CookieUtils.save(CookieUtils.java:297) 
> ~[wicket-core-6.9.1.jar:6.9.1]
>       at 
> org.apache.wicket.util.cookies.CookieUtils.save(CookieUtils.java:184) 
> ~[wicket-core-6.9.1.jar:6.9.1]
> DataTable calls its data provider's iterator method during 
> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender. Apparently 
> at this point the response isn't a WebResponse. Perhaps CookieUtils should be 
> changed to work with a generic Response, using its getContainerResponse 
> method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to