tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Parris <>
Subject Mea Culpa: Apache/Tomcat not setting response codes correctly.
Date Tue, 01 Aug 2000 01:48:28 GMT
Mea Culpa:

I've written a puny client Applet that displays all of the http response
headers returned by Tomcat (or any other http server) given a URL.  It is
setting all of the headers I would expect.  No problem.

However, the Apache logs always indicate a response code of 200.  It still
strikes me that Apache should log the response code given to it by Tomcat
(at least as an option).  This would:

1. Allow an httpd log analyzer to make sense of things (without having to
learn the Tomcat log file formats.

2. Allow Apache to handle the processing for error messages (e.g., 404 not
found pages and the like). Though, for servlet generated error pages, it
would make sense to leave the task with Tomcat (via the <error-page>
directives).  Since developers would likely want to set this parameter for
each web app, it shouldbe handled as an optional third parameter to the
ApJServMount directive in httpd.conf.  Values would be:

log200 -- always log 200 for requests passed through to Tomcat, always let
Tomcat handle the error processing (default)
logTc -- log the response code returned by Tomcat, but let Tomcat process
the errors.
actTc -- log and act on the response code given by Tomcat (e.g., by using
Apaches 404.html file).

-- Tom

Tom Parris wrote:

> Tomcat Users:
> I am new to tomcat, so this may be a naive (or highly redundant)
> question.  However, I have noticed some behavior in the interaction
> between apache and tomcat that I think needs to be fixed. I have tried
> searching list archives, but do not see this mentioned.
> If a tomcat or a servlet explicitly set a status code that is not 200
> (e.g., 404, SC_NOT_FOUND), Apache still returns a status code of 200.
> In my opinion, correct behavior would be for Apache to set the status
> code that is returned by the servlet.
> I am fairly certain that the problem lies with tomcat and not mod_jserv
> or Apache.  When I try to use the http server that is embedded in tomcat
> to access a non existant file, it shows a 404 not found message, but
> does not set the response code to 404 in the http header that is sent to
> my browser.
> Is this a known problem, an unknown problem, or a feature?
> Highest regards,
> Tom

View raw message