+1 -Igor > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Jonathan Locke > Sent: Thursday, August 11, 2005 4:58 PM > To: [email protected] > Subject: Re: [Wicket-develop] Let's talk about exceptions. > > > so we do this: > > protected Page onRuntimeException(final Page page, final > RuntimeException e) > { > return null; > } > > protected final void internalOnRuntimeException(final > Page page, final RuntimeException e) > throws ServletException > { > // let client handle any specifics > final Page redirectTo = onRuntimeException(page, e); > > log.error("Unexpected runtime exception [page = " + > page + "]", e); > > e.printStackTrace(); > // Reset page for re-rendering after exception > if (page != null) > { > page.resetMarkupStreams(); > } > > // If the page we failed to render is an error page > if (page != null && page.isErrorPage()) > { > // give up while we're ahead! > throw new ServletException("Internal Error: Could > not render error page " + page, e); > } > else > { > if (redirectTo != null) > { > setResponsePage(redirectTo); > redirectTo(redirectTo); > } > else > { > try > { > redirectToExceptionErrorPage(page, e); > } > catch (RuntimeException e2) > { > throw new ServletException( > "Internal Error: Could not > redirect to exception error page. Was trying to display > exception for page " > + page + ":\n" + > Strings.toString(e), e2); > } > } > } > } > >
------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
