uCosminexus Application Server, Web Container Functionality Guide
This subsection describes the settings for distributing requests with the redirector.
In the in-process HTTP server, you can distribute requests by the URL pattern included in the HTTP request. You can also customize the response for the distributed request and return a specific file to the client. When the response status code for the request to a redirected URL is 300, the response body is auto-generated and the response is returned to the client. Also, you can use a specified file as a response body. When you specify the file, also specify the Content-Type header of the response.
The auto-generated response body is as follows:
<HTML><HEAD> <TITLE>Status code and explanation</TITLE> </HEAD><BODY> <H1>Status code and explanation</H1> </BODY></HTML> |
The status code for which the response body is auto-generated and the description is as follows:
When the reading of the file used as the response body during request processing fails, if 300 is specified as the status code, the response body is auto-generated and returned to the client. If 200 is specified as the status code, status 500 error is returned to the client.
Specify the definition for distributing requests with the redirector 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 distributing requests with the redirector:
Table 5-11 Definitions in the Easy Setup definition file for distributing requests with the redirector
Parameter to be specified | Setting contents |
---|---|
webserver.connector.inprocess_http.redirect.list | Specifies the redirect definition name. |
webserver.connector.inprocess_http.redirect.redirect-difinition-name.request_url | Specifies the URL of the redirected request as an absolute path beginning with a slash (/). |
webserver.connector.inprocess_http.redirect.redirect-difinition-name.redirect_url | Specifies the URL for redirecting the request. Note that when 200 is specified as the status code, the URL cannot be specified. |
webserver.connector.inprocess_http.redirect.redirect-difinition-name.status | Specifies the response status code used when redirection is executed. |
webserver.connector.inprocess_http.redirect.redirect-difinition-name.file | Specifies the file to be used as the response body when a specific file is returned to the client as a response. Note that when 200 is specified as the status code, the file to be used must be specified. |
webserver.connector.inprocess_http.redirect.redirect-difinition-name.file.content_type | Specifies the Content-Type header of the file to be used as the response body when a specific file is returned as a response to the client. |
For details on the Easy Setup definition file and the parameters to be specified, see the uCosminexus Application Server Definition Reference Guide.
An example of settings for request distribution with the redirector is as follows:
... <param> <param-name>webserver.connector.inprocess_http.redirect.list</param-name> <param-value>REDIRECT_1, REDIRECT_2</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_1.request_url</param-name> <param-value>/index.html</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_1.redirect_url</param-name> <param-value>http: //host1/new_dir/index.html</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_1.status</param-name> <param-value>302</param-value> </param> <param> <param-name>webserver.connector.inprocess_http.redirect.REDIRECT_2.request_url</param-name> <param-value>/old_dir/*</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_2.redirect_url</param-name> <param-value>http: //host1/new_dir/</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_2.status</param-name> <param-value>301</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_2.file</param-name> <param-value>C: /data/301.html</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_2.file.content_type</param-name> <param-value>text/html; charset=ISO-8859-1</param-value> </param> ... |
... <param> <param-name>webserver.connector.inprocess_http.redirect.list</param-name> <param-value>REDIRECT_3</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_3.request_url</param-name> <param-value>/dir1/*</param-value> </param> <param> |
<param-name>webserver.connector.inprocess_http.redirect.REDIRECT_3.redirect_url</param-name> <param-value>http: //host/dir2/</param-value> </param> ... |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.