You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Baptist <an...@quiq.com> on 2001/06/21 01:24:48 UTC

Problem with sendError

I am using tomcat 3.2.2 with apache 1.3.20 using the mod_jk connector between 
the two. I have basically written a tiny servlet with this one method:

public void doGet(HttpServletRequest req, HttpServletResponse res) throws 
IOException {
    res.sendError(500, "tomcat error");
}

In my apache httpd.conf file I have the following line. 

ErrorDocument 500 "apache error

What I want to happen is for apache to see the 500 error and return the 
"apache error" string when the servlet is hit, however the "tomcat error" 
string is returned. Note: If the Jserv is down completly, the "apache error" 
string is returned.

This used to work correctly (or at least return the "apache error" string) 
with the old setup I had apache 1.3.12, Apache/Jserv 1.1, mod_jserv. Is there 
any way to change either the apache server or the java code to get back the 
old behavior.

The reason having apache return the error is preferrable is it allows 
centralized error reporting for a set of different errors (404, 503, ...)

Andrew