You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Carlos Pereira <kh...@portugalmail.pt> on 2003/10/03 17:24:59 UTC

error-page directive

 I am using Tomcat 4.1.24 in Windows XP and I cannot define an error page. I have defined it in web.xml as

 <error-page>
    <error-code>500</error-code>
    <location>/errorpage.hmtl</location>
  </error-page>

and none of them works. The page displayed is Tomcat's default error page. The error-page tag seems to be simply ignored, as no errors are found in the application initialization.
 If I use 

  <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/errorpage.html</location>
  </error-page>

and throw an exception, like RuntimeException, IE shows it's default Error 500 - Internal Server Error page.

 I tried to put errorpage.html both in the server's root and the application's context root. It doesn't work.

 I tried switching the location for a servlet mapping, like /error. It doesn´t work.

 I upgraded Tomcat to 5.0.12. The result is the same.

 So, what's the problem?

 Regards,
 Carlos Pereira

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: error-page directive

Posted by Anton Tagunov <at...@mail.cnt.ru>.
Hello Carlos!

CP> IE shows it's default Error 500 - Internal Server Error page.

I recall there was an issue with some version of IE: it had
a "feature": if the error page is less then x bytes then IE showes
its ugly default error page. But if the error page is large
enough (in terms of bytes) then it showes that.

I recall (I was at it several years ago) that Cocoon machinery
for reporting errors was on purpose filling the error report
to be large enough somehow (probably it was sipmply adding
spaces, don't remember).

So, try to use a _really large_ page as your error page.
Please let us know if this works. If it does it is worth
adding to the faq.

Anton


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: error-page directive

Posted by Graham Reeds <gr...@omnieng.co.uk>.
----- Original Message -----
From: "Carlos Pereira" <kh...@portugalmail.pt>
To: <to...@jakarta.apache.org>
Sent: Friday, October 03, 2003 4:24 PM
Subject: error-page directive


> I am using Tomcat 4.1.24 in Windows XP and I cannot define an error page.
I have defined it in web.xml as
>
>  <error-page>
>     <error-code>500</error-code>
>     <location>/errorpage.hmtl</location>
>   </error-page>

If this is a cut'n'paste job from your web.xml page then the problem is you
have defined a .hmtl and not .html file.

G.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org