Customize error messages
If an error occurs during rendering, the JSR 286 Web Content Viewer shows an error screen. 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. You can customize the default error screen, and you can create your own custom JSP file that is used to display error messages.
- Create a customized error JSP file.
- Copy the original error.jsp file from profile_root/installedApps/node_name/PA_WCMLRingPortJSR286.ear/ilwwcm‑localrende.war/jsp/html directory to create custom error JSP file. Almost everything in the original JSP file can be changed according to your requirements.
The essential part that should be retained in your error JSP file, if it is intended to display the actual cause, is:
<%-- 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 of the error. In the original error.jsp this message is only displayed in a separate popup window when a user selects View details link.
In some cases it might not be desired to show this message to a user.
- Configure the Web Content Viewer to use the customized error JSP file.
- Log in to the portal as an administrator.
- Click Administration in the tool bar.
- Under Portlet Management in the navigation tree, click Portlets.
- Locate the Web Content Viewer (JSR 286) portlet.
- Click Configure Portlet.
- Edit the value of the parameter ERROR_JSP, and set the path to customized error JSP file as the parameter value.
The path you enter to custom error JSP file must be relative to the profile_root/installedApps/node_name/PA_WCMLRingPortJSR286.ear/ilwwcm‑localrende.war directory.
- Click OK, and then click OK again.
Parent topic:
Use the JSR 286 Web Content Viewer