ClassCastException (WebResponse)

2012-12-10 Thread Corbin, James
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)

2012-12-10 Thread Paul Bors
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:jcor...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: ClassCastException (WebResponse)

2012-12-10 Thread Corbin, James
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 p...@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:jcor...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





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