Hitachi

uCosminexus Application Server Compatibility Guide


5.8.2 Mechanism of error page customization

This section describes the mechanism of the process of error page customization when an error occurs in the Web container and when an error occurs in the redirector.

When an error occurs in the Web container

The redirector receives the error status codes sent from the Web container. The redirector assigns creation of error pages to the Web server, and the Web server sends the user created pages corresponding to the error status codes to the client. As a result, the pages created by the user are displayed in the client.

The following figure shows the processing flow of error page customization:

Figure 5‒21: Processing of displaying error pages created by the user (when the Web server functionality is used)

[Figure]

Stages 1 to 3 of the figure are explained below:

  1. If the client accesses a non-existent resource, the Web container sends error 404 to the Web server.

  2. When the redirector receives error 404, it requests the Web server to generate an error page corresponding to error 404, based on the setting information#.

  3. The Web server returns the error page missing.html corresponding to error 404 to the client according to the setting information#.

When an error occurs in the redirector

If an error occurs in the redirector, the redirector requests the Web server to generate an error page corresponding to the occurred error, on the basis of the setup information. The Web server sends the user-created page corresponding to the error status code to the client, based on the setup information#. As a result, the pages created by the user are displayed in the client.

#

To customize the error pages, you need to specify the relationship between the error status code and the error page, beforehand.

The following figure shows an overview of the relationship.

Figure 5‒22: Specifying the relationship between the error status code and the error page (by using the Web server functionality)

[Figure]

When an error occurs, in order to display the error page created by the user instead of the error page displaying the error status code, you associate the error page created by the user to a specific error status code. When an error with the applicable error status code occurs, the error page corresponding to the error status code is sent to the client, on the basis of the information set in the Web server (Cosminexus HTTP Server).