Hitachi

uCosminexus Application Server Compatibility Guide


5.8.4 Execution environment settings (When the Smart Composer functionality is not used)

This section describes the settings for error page customization.

Organization of this subsection

(1) How to set

Define the association between the error status code and error page in the following files:

Precautions related to workers.properties settings
  • Specify the error status code for each worker.

  • The worker type that can specify the error status code is only ajp13. If the worker type is lb (settings specified for load balancing based on the round-robin format), the specified contents are ignored.

  • The specifiable error status code is listed in the following table. The error page cannot be associated with error status codes other than the followings:

    Table 5‒20: Error status codes that can be associated with error pages

    Error status codes

    Explanation

    400

    Bad Request

    401

    Unauthorized

    402

    Payment Required

    403

    Forbidden

    404

    Not Found

    405

    Method Not Allowed

    406

    Not Acceptable

    407

    Proxy Authentication Required

    408

    Request Time-out

    409

    Conflict

    410

    Gone

    411

    Length Required

    412

    Precondition Failed

    413

    Request Entity Too Large

    414

    Request-URI Too Long

    415

    Unsupported Media Type

    416

    Requested Range Not Satisfiable

    417

    Expectation Failed

    422

    Unprocessible Entity

    423

    Locked

    424

    Failed Dependency

    500

    Internal Server Error

    501

    Not Implemented

    502

    Bad Gateway

    503

    Service Unavailable

    504

    Gateway Time-out

    505

    HTTP Version not supported

    507

    Insufficient Storage

    510

    Not Extended

Precautions for specifying the ErrorDocument directive
  • When using the local URL in the ErrorDocument directive, specify a URL that the redirector will not forward to the Web Container.

  • When the URL pattern /* is mapped to a worker in the redirector settings such as for using the root context, all the requests are forwarded to the Web container. Therefore, in the ErrorDocument directive, set the resources on the Web container by using the complete URL.

    The following example describes the settings for displaying error404.jsp under the root context on the Web container when the root context is used and the error status code 404 occurs. The hostA is the host operating the Web server.

    ErrorDocument 404 http://hostA/error404.jsp

    Also, when the Web container is not running, the redirector returns an error with error status code 500. Therefore, for customizing the error page when the Web container is not running, you must specify other Web server resources for the error status code 500 using the complete URL, in the ErrorDocument directive.

(2) Example settings

The following is an example of error page customization:

Example of workers.properties
# Description of worker definition file
worker.list=worker1
 
worker.worker1.type=ajp13
worker.worker1.host=host1
worker.worker1.port=8007
worker.worker1.delegate_error_code=404

Define the error status code '404(Not Found)' in the worker.worker-name.delegate_error_code key.

Example of httpsd.conf
# Description of httpsd.conf#
#  ...
ErrorDocument 404 /missing.html

The error status code and the file name of the corresponding error page are associated. When an error with error status code '404(Not Found)' occurs, the missing.html file is displayed.

For details on the ErrorDocument directive, see the uCosminexus Application Server HTTP Server User Guide.