You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by 李征 <us...@yahoo.com.cn> on 2008/10/17 10:31:04 UTC

about tomcat default error page

i use apache with tomcat.
i don't want tomcat to generate its default error page when a error happens.
instead, i want to show my error page which i set in the apache conf file.

i know that  i can use <error-page> to do this, but i don't want to do it twice -- both apache and tomcat.
is there any configuration that makes tomcat do nothing about the error and just simplely pass the reponse code to apache.

thanks in advance.

__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com

Re: about tomcat default error page

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

李征,

李征 wrote:
> i use apache with tomcat.
> i don't want tomcat to generate its default error page when a error happens.
> instead, i want to show my error page which i set in the apache conf file.
> 
> i know that  i can use <error-page> to do this, but i don't want to do it twice -- both apache and tomcat.

You can just use ErrorDocument within a <Location> section in your
httpd.conf. I do this for errors like 403 and 500, so I'd imagine it
would work with other error codes as well. I believe Apache httpd simply
ignores the body of the TC response and replaces it with its own.

Hmm... I see that I /have/ configured the error pages in both Apache
httpd /and/ Tomcat, so I'm not sure which of the configurations is
really active.

Honestly, I don't see what the big deal is about double-configuring
these error pages.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj8i8gACgkQ9CaO5/Lv0PDKxACfdBMxP7COYYAZTLiCVBD6C3kN
qycAoLd/8UL02Locmbp/dielGM+oZy7v
=t5pi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: about tomcat default error page

Posted by André Warnier <aw...@ice-sa.com>.
Hi 李征,
I don't know the answer to your question, but here is a recommendation :
To avoid delays in answering your question, it is always helpful to
specify :
- on which platform this happens (Windows, Unix, Linux,..)
- what version of Apache
- what version of Tomcat
- what connector you use between them (mod_jk, proxy_ajp,..) and its
version.

In this case, it matters very much, because the exact answer to your
question may be very dependent on this information.

If you do not specify it, then whoever is the expert will have to ask
you first, and because of time differences you might not see his
question before tomorrow, and then when you answer he may not see your
answer before his own tomorrow,.. and presto 48 hours have gone by.

Now if the versions of all the above that you use are fairly recent, and
you use the mod_jk connector, then you may want to look at the latest
release notes of mod_jk.  I am not sure, but I think I remember seeing
something that was more or less around that subject.

André


李征 wrote:
> i use apache with tomcat.
> i don't want tomcat to generate its default error page when a error happens.
> instead, i want to show my error page which i set in the apache conf file.
> 
> i know that  i can use <error-page> to do this, but i don't want to do it twice -- both apache and tomcat.
> is there any configuration that makes tomcat do nothing about the error and just simplely pass the reponse code to apache.
> 
> thanks in advance.
> 
> __________________________________________________
> 赶快注册雅虎超大容量免费邮箱?
> http://cn.mail.yahoo.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org