onException() 1.5

2012-02-29 Thread Douglas Ferguson
I want to redirect to an error page when there is an Exception.

I see that there is a RedirectRequestHandler, but this only allows you to 
redirect to url via string literal.
I want to redirect to a construction Page.

I was grasping at straws and tried this and no dice..


public IRequestHandler onException(RequestCycle cycle, 
Exception ex)
{
cycle.setResponsePage(new 
NotifyUserOfException());
return cycle.getActiveRequestHandler();
}

Re: onException() 1.5

2012-02-29 Thread Martin Grigorov
On Thu, Mar 1, 2012 at 9:46 AM, Douglas Ferguson the...@gmail.com wrote:
 I want to redirect to an error page when there is an Exception.

 I see that there is a RedirectRequestHandler, but this only allows you to 
 redirect to url via string literal.
 I want to redirect to a construction Page.

 I was grasping at straws and tried this and no dice..


                        public IRequestHandler onException(RequestCycle cycle, 
 Exception ex)
                        {
                                cycle.setResponsePage(new 
 NotifyUserOfException());
                                return cycle.getActiveRequestHandler();

WebPage exceptionPage = new NotifyUserOfException(ex);
IPageProvider provider = new PageProvider(page);
return new RenderPageRequestHandler(provider /*,
RenderPageRequestHandler.RedirectPolicy.XYZ */ );

                        }



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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