4.8.4 Execution environment settings (When the Smart Composer functionality is not used)
(1) How to set
Define the association between the error status code and error page in the following files:
- workers.properties
Specify the error status code that you want associated with the error page in the worker.worker-name.delegate_error_code key.
For details on workers.properties (worker definition file), see 9.5 workers.properties (worker definition file) in the uCosminexus Application Server Definition Reference Guide.
- httpsd.conf
Associate the error status code and the file name of the corresponding error page in the ErrorDocument directive.
For details on httpsd.conf (HTTP Server definition file), see the uCosminexus Application Server HTTP Server User Guide.
- Precautions related to workers.properties settings
- 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.