+

Search Tips   |   Advanced Search

Customize error messages for web content viewers

If an error occurs during rendering, the web content viewer shows an error screen. We can customize the default error screen, and we can create the own custom JSP file used to display error messages.

The default error screen provides a standard error message, which is shown on every type of error, and a more detailed error message. The detailed error message provides information about the cause of the error and is displayed when you click the View details link.

  1. Create a customized error JSP file.

    1. Copy the original error.jsp file from wp_profile_root/installedApps/node/PA_WCMLRingPortJSR286.ear/ilwwcm‑localrende.war/jsp/html directory to create the custom error JSP file.

      Almost everything in the original JSP file can be changed according to the requirements. To show the cause of the error, retain this part of the original file in the error JSP file:

      <%-- use errorbean from request --%> 
      <jsp:useBean id="errorbean" scope="request" 
          type="com.ibm.portal.portletui.messages.StatusMessageBean" /> 
      <% String msg = errorbean.getMessage(); %> 
      

      The variable msg contains the message text of the error. In the original error.jsp file, this message is only shown in a separate window if a user selects the View details link.

  2. Configure the web content viewer to use the customized error JSP file.

    1. Log in to the portal as an administrator.

    2. Navigate to Administration > Portlet Management > Portlets.

    3. Locate the Web Content Viewer (JSR 286) portlet.

    4. Click Configure Portlet.

    5. Edit the value of the ERROR_JSP parameter, and set the path to the customized error JSP file as the parameter value.

      Storing JSP files: We can store JSP files in one of two locations:

      • Within the wp_profile_root/installedApps/node/PA_WCMLRingPortJSR286.ear/ilwwcm-localrende.war directory of the server. When storing JSP files in this directory, enter the path to the custom error JSP relative to the directory.

      • Within any other web application running on the portal. When referencing JSP files in another web application, use the following path: contextPath;jspPath. For example: /wps/customapplication;/jsp/error.jsp.


Parent: Customize web content delivery