When 2 application servers run together, it's not simple to have a right management for response codes and the famous 404 page.
Where manage this page ? In httpd ? In tomcat ? How to be sure that it's correctly configured ?
When 2 application servers work on the same application, we must know which is the job of each one.
Usually, the httpd server delivers static resources aa static pages (.htm et .html), scripts (.js et .css) and images (.jpg, .gif, .png). Tomcat's job is to deliver servlets and JSP pages.
Each server is able to manage itself the error page (and its error code) when a resource is unavailable.
For httpd, it's done by the DocumentError guideline taken 2 parameters (the error code and the page which is affected). In example :
and for tomcat it's done by the following xml block :
The problem is : how unify these 2 "404 pages".
There are many possibilities :
- Using 2 different pages, one for httpd and the other for tomcat
- Using one HTML page for both servers
- Using a JSP page for httpd and tomcat
The only "satisfying" solution providing a customizable error page with the right response code (404) is to setting an unavailable page to httpd...
For example, for httpd :
and for tomcat :
So, when a requested static resource is unavailable, httpd will try to produce a JSP page which doesn't exist. Tomcat will return the right error page with the right code...
Articles similaires
| Comments |
|














