Table of Contents Previous Section
Error Handling
When an error occurs, WebObjects by default returns a page containing debugging information and displays that page in the Web browser. This information is useful when you're in the debugging phase, but when you're ready to deploy, you probably want to make sure that your users don't see such information.The WOApplication class provides the following methods that you can override to show your own error page.
public WOResponse handleException(java.lang.Throwable anException, WOContext aContext) {Notice that this method, and all of the error-handling methods, return a WOResponse object instead of a WOComponent object.
WOResponse response = aContext.component().
pageWithName("ErrorPage").generateResponse();
return response;
}
Table of Contents Next Section