You can display your own error page when an error that is not handled by an Error Handler builder occurs in a model.
Do one of the following:
- Override the default page provided and substitute your own JSP error page (preferred).
Create an alternate JSP error page for display.
- In the factory/webapp/ directory, create your own JSP error page.
Use the defaulterror.jsp in the directory as a model.
- Open the override.properties file located in the project /WEB-INF/config directory.
- Change the IBM® WebSphere® Portlet Factory property that determines the error page that is called when an unhandled error occurs.
Edit the following comment and property entry that specifies the page to be displayed.
# Default error page (JSP) for unhandled exceptions.
In the property entry, replace the name of the defaulterror.jsp
page with the name of your JSP error page.
Because the WebContent/WEB-INF/config
directory is by default an excluded resource, you need to override the team file and directory exclusion to ensure that your new or modified file is kept updated in source control storage.
- Make a backup copy the existing default error page factory/webapp/defaulterror.jsp.
- Modify the original as required.
Your alternate JSP page can be overwritten if you upgrade WebSphere Portlet Factory versions.
The Throwable instance of the Java Exception object is automatically made available to the JSP error page to be displayed or logged.
Parent topic: Handling errors in web applications: wpf7
Files that are excluded from source control: wpf7