You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Corbin, James" <jc...@iqnavigator.com> on 2012/12/10 20:33:13 UTC

ClassCastException (WebResponse)

I have the following code that is generating a ClassCastException that I do not fully understand,


(WebResponse)RequestCycle.get().getResponse();


The actual type of the value returned is org.apache.wicket.ajax.AbstractAjaxResponse$AjaxResponse.


I'm trying to understand why this call returns an AjaxResponse instead of a WebResponse, in my case.  I don't believe the code where this code get executed is in the context of Ajax.


J.D.

Re: ClassCastException (WebResponse)

Posted by "Corbin, James" <jc...@iqnavigator.com>.
Yeah, it is.  The action was triggered via an AjaxLink which I didn't
realize at the time.  Is there a way to get access to the WebResponse in
this scenario?  I need to delete a cookie, but obviously, you cannot do so
through an AjaxResponse.

J.D.


On 12/10/12 12:56 PM, "Paul Bors" <pa...@bors.ws> wrote:

>Most likely because it is an Ajax response... :)
>
>Do you have the AjaxIndicator somewhere on your page and does it indicate
>an
>Ajax request cycle happening?
>What about while in DEVELOPMENT mode, can you monitor the page activity
>using the Wicket Ajax Debug Window?
>
>FYI, while in DEVELOPMENT mode you might want to add the DebugBar to your
>page as well.
>
>~ Thank you,
>  Paul Bors
>
>-----Original Message-----
>From: Corbin, James [mailto:jcorbin@iqnavigator.com]
>Sent: Monday, December 10, 2012 2:33 PM
>To: users@wicket.apache.org
>Subject: ClassCastException (WebResponse)
>
>I have the following code that is generating a ClassCastException that I
>do
>not fully understand,
>
>
>(WebResponse)RequestCycle.get().getResponse();
>
>
>The actual type of the value returned is
>org.apache.wicket.ajax.AbstractAjaxResponse$AjaxResponse.
>
>
>I'm trying to understand why this call returns an AjaxResponse instead of
>a
>WebResponse, in my case.  I don't believe the code where this code get
>executed is in the context of Ajax.
>
>
>J.D.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: ClassCastException (WebResponse)

Posted by Paul Bors <pa...@bors.ws>.
Most likely because it is an Ajax response... :)

Do you have the AjaxIndicator somewhere on your page and does it indicate an
Ajax request cycle happening?
What about while in DEVELOPMENT mode, can you monitor the page activity
using the Wicket Ajax Debug Window?

FYI, while in DEVELOPMENT mode you might want to add the DebugBar to your
page as well.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Corbin, James [mailto:jcorbin@iqnavigator.com] 
Sent: Monday, December 10, 2012 2:33 PM
To: users@wicket.apache.org
Subject: ClassCastException (WebResponse)

I have the following code that is generating a ClassCastException that I do
not fully understand,


(WebResponse)RequestCycle.get().getResponse();


The actual type of the value returned is
org.apache.wicket.ajax.AbstractAjaxResponse$AjaxResponse.


I'm trying to understand why this call returns an AjaxResponse instead of a
WebResponse, in my case.  I don't believe the code where this code get
executed is in the context of Ajax.


J.D.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org