When an error such as the access to non-existent resources occurs, a user-created error page can be displayed to the client instead of the error page displaying the error status code.
By using the error page customization with the in-process HTTP server, you can control error page customization corresponding to a specific status code and error page customization corresponding to a request URL in the Web Container at the same time. You can also customize the error page even when you cannot customize the error page with the Web applications in the following cases:
- When the context corresponding to the request does not exist (status code 404)
- When an attempt is made to process the request with a context that is in the process of stopping (status code 503)
- When the in-process HTTP server returns an error status code
For details on the error status codes returned by the in-process HTTP server, see Appendix A.3 Error status codes returned by the in-process HTTP server.
In the in-process HTTP server, you can customize the following error pages:
- Error page customization corresponding to the status codes
You can customize the error pages corresponding to the status codes 400 and 500.
By customizing the error pages corresponding to the status code, you can send the files corresponding to the status code and execute redirection corresponding to the status code.
- Sending the files corresponding to the status code
You can return to the client a specific file as a response body for the customized status code. In this case, specify the Content-Type header value of the response.
Note that if the reading of the file fails during request processing, the default error page is used.
- Redirection corresponding to the status code
You can redirect to a specific URL for the customized status code. In the case of redirection, specify 302 as the response status code and the redirect URL in the Location header.
When sending a file corresponding to the status code, redirection cannot be executed.
- Error page customization corresponding to the request URLs
You can specify a request URL and customize the error page for a specific URL. When the request URL is specified, the customized error page is returned to the client only when an error occurs in the request processing matching with the specified URL.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.