Portlet Factory, Version 6.1.2


 

Displaying a custom error page for unhandled errors

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).

    1. In the factory/webapp/ directory, create your own JSP error page.

      Use the defaulterror.jsp in the directory as a model.

    2. Open the override.properties file located in the project /WEB-INF/config directory.
    3. 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.
       bowstreet.webapp.errorHandler=/factory/webapp/defaulterror.jsp

      In the property entry, replace the name of the defaulterror.jsp page with the name of your JSP error page.

  • Create an alternate JSP error page for display.

    1. Make a backup copy the existing default error page factory/webapp/defaulterror.jsp.

    2. 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: Advanced error handling techniques Parent topic: About error handling in web applications


Library | Support |