Deployment and Performance Issues
PATH
WebObjects 4.0 Documentation >
WebObjects Developer's Guide
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.
For example, the following implementation of handleException:inContext: returns a component named ErrorPage whenever an error occurs in the application.
public WOResponse handleException(java.lang.Throwable
anException, WOContext aContext) {
WOResponse response = aContext.component().
pageWithName("ErrorPage").generateResponse();
return response;
}
Notice that this method, and all of the error-handling methods, return a WOResponse object instead of a WOComponent object.
Table of Contents
Next Section