You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Douglas Ferguson <do...@douglasferguson.us> on 2010/02/07 08:53:25 UTC

AbortException

I may be using this wrong, but my understanding was that if I wanted to redirect a user and hault execution of the current page I could do the following:

setResponsePage(LinkPartners.class);
throw new AbortException();

However, there seems to be situations where the AbortException actually bubbles back up to the user.
What would cause the redirect not to work and the AbortException to make it to the screen?

D/

Re: AbortException

Posted by Douglas Ferguson <do...@douglasferguson.us>.
This was some really silly stuff in our code..

https://buzzstream2.fogbugz.com/default.asp?5102#31036

On Feb 7, 2010, at 2:20 AM, Martin Grigorov wrote:

> 
> throw new RestartResponseException(LinkPartners.class)
> 
> On Sat, 2010-02-06 at 23:53 -0800, Douglas Ferguson wrote:
>> I may be using this wrong, but my understanding was that if I wanted to redirect a user and hault execution of the current page I could do the following:
>> 
>> setResponsePage(LinkPartners.class);
>> throw new AbortException();
>> 
>> However, there seems to be situations where the AbortException actually bubbles back up to the user.
>> What would cause the redirect not to work and the AbortException to make it to the screen?
>> 
>> 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: AbortException

Posted by Erik van Oosten <e....@grons.nl>.
Throwing a RestartResponseException will not redirect but restart the 
request handling. To force the redirect as well, you can call
  setRedirect(true)
just before throwing the exception.

But I doubt it will work for you; when you have an error page without 
the redirect, you will probably also have it with the redirect.

Regards,
    Erik.


Douglas Ferguson wrote:
> I tried that and it doesn't redirect, it throws the error back up and renders our error page
>   
>> org.apache.wicket.RestartResponseException:null
>>     
>
>
> On Feb 7, 2010, at 2:20 AM, Martin Grigorov wrote:
>   
>> throw new RestartResponseException(LinkPartners.class)
>>
>> On Sat, 2010-02-06 at 23:53 -0800, Douglas Ferguson wrote:
>>     
>>> I may be using this wrong, but my understanding was that if I wanted to redirect a user and hault execution of the current page I could do the following:
>>>
>>> setResponsePage(LinkPartners.class);
>>> throw new AbortException();
>>>
>>> However, there seems to be situations where the AbortException actually bubbles back up to the user.
>>> What would cause the redirect not to work and the AbortException to make it to the screen?
>>>
>>> D/
>>>       


-- 
Send from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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


Re: AbortException

Posted by Douglas Ferguson <do...@douglasferguson.us>.
I tried that and it doesn't redirect, it throws the error back up and renders our error page

> org.apache.wicket.RestartResponseException:null



On Feb 7, 2010, at 2:20 AM, Martin Grigorov wrote:

> 
> throw new RestartResponseException(LinkPartners.class)
> 
> On Sat, 2010-02-06 at 23:53 -0800, Douglas Ferguson wrote:
>> I may be using this wrong, but my understanding was that if I wanted to redirect a user and hault execution of the current page I could do the following:
>> 
>> setResponsePage(LinkPartners.class);
>> throw new AbortException();
>> 
>> However, there seems to be situations where the AbortException actually bubbles back up to the user.
>> What would cause the redirect not to work and the AbortException to make it to the screen?
>> 
>> 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: AbortException

Posted by Martin Grigorov <mc...@e-card.bg>.
throw new RestartResponseException(LinkPartners.class)

On Sat, 2010-02-06 at 23:53 -0800, Douglas Ferguson wrote:
> I may be using this wrong, but my understanding was that if I wanted to redirect a user and hault execution of the current page I could do the following:
> 
> setResponsePage(LinkPartners.class);
> throw new AbortException();
> 
> However, there seems to be situations where the AbortException actually bubbles back up to the user.
> What would cause the redirect not to work and the AbortException to make it to the screen?
> 
> D/



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