+1 It's a handy class and should be put in the API.
Alex Jacoby-2 wrote: > > +1 > > I did something similar but not nearly so elegant. This would have > been nice to have. > > On May 7, 2008, at 3:22 AM, Johan Compagner wrote: > >> add this to the api... >> Because this is the second question about this in a very short time.. >> >> johna >> >> >> On Wed, May 7, 2008 at 7:47 AM, Martijn Dashorst >> <[EMAIL PROTECTED] >> > >> wrote: >> >>> Perhaps this one helps? >>> >>> public class RedirectToExternalException extends >>> AbstractRestartResponseException >>> { >>> private static final long serialVersionUID = 1L; >>> >>> public RedirectToExternalException(String url) >>> { >>> >>> RequestCycle rc = RequestCycle.get(); >>> if (rc == null) >>> { >>> throw new IllegalStateException( >>> "This exception can only be >>> thrown from within request processing cycle"); >>> } >>> else >>> { >>> Response r = rc.getResponse(); >>> if (!(r instanceof WebResponse)) >>> { >>> throw new IllegalStateException( >>> "This exception can >>> only be thrown when wicket is processing an >>> http request"); >>> } >>> >>> // abort any further response processing >>> rc.setRequestTarget(new >>> RedirectRequestTarget(url)); >>> } >>> } >>> } >>> >>> On 5/7/08, TH Lim <[EMAIL PROTECTED]> wrote: >>>> >>>> RestartResponseException worked but it doesn't accept external >>>> URL. As >>> a >>>> result, I have to put the redirection in the dummy Page's HTML >>>> header. >>>> >>>> Someone in the forum mentioned using WebApplication.getHomePage() to >>> get >>>> around but that too requires you to put up a dummy Page to >>>> redirect to >>> the >>>> external site as mentioned in previous paragraph. >>>> >>>> Thanks for the replies. Now I have a choice to make after becoming >>>> more >>>> knowledgeable on this issue. >>>> >>>> >>>> >>>> Eelco Hillenius wrote: >>>>> >>>>>> I tried both AbortException and RestartResponseException. They >>> didn't >>>>>> work. >>>>>> AbortException basically causes Wicket to show a blank page >>>>>> instead >>> of >>>>>> redirecting to the external site while RestartResponseException >>> caused >>>>>> stack >>>>>> overflow error. The exceptions were thrown in >>>>>> onUnauthorizedInstantiation(...) method. >>>>> >>>>> You should use the RestartResponseException, not AbortException >>>>> directly. The stack overflow error is something you can fix >>>>> yourself; >>>>> make sure you redirect to a page that won't cause these redirects >>>>> to >>>>> be triggered again. >>>>> >>>>> Eelco >>>>> >>>>> --------------------------------------------------------------------- >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> View this message in context: >>> http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17093829.html >>>> >>>> Sent from the Wicket - User mailing list archive at Nabble.com. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>> >>> >>> -- >>> Buy Wicket in Action: http://manning.com/dashorst >>> Apache Wicket 1.3.3 is released >>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Private-Homepage-Redirection-tp17079231p17106174.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]