You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yue Mu <yu...@yahoo.com> on 2006/02/05 07:05:48 UTC

Custom HTTP 503 Error Page Not Working - Tomcat 5.5.15

Greetings,
   
  I have searched the internet and seen this same question being asked several times but never got answered (http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg156810.html and  http://www.junlu.com/msg/195207.html ). I also checked the Servlet 2.4 Spec and Tomcat Docs but could not find answers.
   
  The Problem:
   
  With the default installation of Tomcat 5.5.15, I am trying to set up custom error pages for HTTP errors 4xx and 5xx. To simplify things, assume the following is added to a web application's web.xml (after <welcome-file-list>) and error pages are in the top level directory of the web application.
  
    <error-page>
       <error-code>404</error-code>
       <location>/error404.jsp</location>
    </error-page>
      <error-page>
       <error-code>500</error-code>
       <location>/error500.jsp</location>
    </error-page>
      <error-page>
       <error-code>503</error-code>
       <location>/error503.jsp</location>
    </error-page>
  

  It works fine for HTTP 404 and 500 errors. That is, for HTTP 404 and 500 errors it returns the custom error pages error404.jsp and error500.jsp, respectively. However, when the web application is stopped (unavailable), it returns the default Tomcat 503 error page (see below), not the custom error page.
   
  Any help would be greatly appreciated!
   
  Thanks,
  YM
   
  -- Tomcat default error page --
   
    HTTP Status 503 - This application is not currently available  
---------------------------------
    type Status report
  message This application is not currently available
  description The requested service (This application is not currently available) is not currently available.
  
---------------------------------
    Apache Tomcat/5.5.15
  -------------------------------------------
   

		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!