Hitachi

uCosminexus Application Server Compatibility Guide


6.15.3 Execution environment settings (J2EE server settings)

To customize the error pages, you must set up the J2EE server.

This section describes the settings and examples for error page customization.

Organization of this subsection

(1) How to set

Implement the J2EE server settings in the Easy Setup definition file. Specify the definition for error page customization in the <configuration> tag of the logical J2EE server (j2ee-server) in the Easy Setup definition file.

The following table lists the definitions in the Easy Setup definition file for the error page customization:

Table 6‒22: Definitions in the Easy Setup definition file for error page customization

Parameter to be specified

Setting contents

webserver.connector.inprocess_http.error_custom.list

Specifies the definition name for error page customization.

webserver.connector.inprocess_http.error_custom.error-page-customising-definition-name.status

Specifies the error status code that customizes the error page to customize the error page in association with the error status code.

webserver.connector.inprocess_http.error_custom.error-page-customising-definition-name.file

Specifies the file to be returned to the client as a response body to send a file corresponding to the error status code.

webserver.connector.inprocess_http.error_custom.error-page-customising-definition-name.file.content_type

Specifies the value of the Content-Type header when a file specified in the webserver.connector.inprocess_http.error_custom.error-page-customizing-definition-name.file parameter is sent to the client as a response body.

webserver.connector.inprocess_http.error_custom.error-page-customising-definition-name.redirect_url

Specifies the redirection destination URL when redirecting in compliance with the error status code.

webserver.connector.inprocess_http.error_custom.error-page-customising-definition-name.request_url

Specifies the request URL that applies error page customization when customizing the error page in association with the request URL.

For details on the Easy Setup definition file and the parameters to be specified, see 4.3 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.

(2) Example of settings

The following is the setting example of settings for the error page customization:

...
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.list</param-name>
  <param-value>ERR_CUSTOM_1,ERR_CUSTOM_2</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_1.status</param-name>
  <param-value>404</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_1.file</param-name>
  <param-value>C:/data/404.html</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_1.file.content_type</param-name>
  <param-value>text/html; charset=ISO-8859-1</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_2.status</param-name>
  <param-value>503</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_2.redirect_url</param-name>
  <param-value>http://host1/503.html</param-value>
</param>
<param>
  <param-name>webserver.connector.inprocess_http.error_custom.ERR_CUSTOM_2.request_url</param-name>
  <param-value>/dir1/*</param-value>
</param>
...

In this example, ERR_CUSTOM_1 and ERR_CUSTOM_2 are used as the error page customizing definition names. In ERR_CUSTOM_1, when the response status code is '404', C:/data/404.html is returned to the client. text/html; charset=ISO-8859-1 is used as the Content-Type header value. In ERR_CUSTOM_2, when the request is a URL beginning with /dir1/ and the response status code is '503', the request is redirected to http://host1/503.html.