tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: displaying customized error page in tomcat 5.5.12
Date Wed, 16 May 2007 11:29:31 GMT
In order for the custom error page to be used, the application must be
deployed.  I.e., Tomcat can give a custom 404 for
/mycontext/badpagerequested.jsp but if there is no context "/mycontext"
because the app is not (yet) deployed, Tomcat cannot know about your custom
error page.

I'm guessing you can add a global error-page to Tomcat's conf/web.xml, but
then it would apply to all apps on the server.  This may or may not work for
you.

If you have fronted Tomcat with httpd, you might be able to use custom error
pages there instead.  JK will send a 503 if the application is not currently
available.

Tim


> -----Original Message-----
> From: Abdul Qayyum [mailto:qayyum4@gmail.com]
> Sent: Wednesday, May 16, 2007 6:27 AM
> To: users@tomcat.apache.org
> Subject: displaying customized error page in tomcat 5.5.12
> 
> Hi all,
>  I found that while we are updating our application, the application is
> not
> known to tomcat, untill it is completed. So tomcat sends 503
> page as resource not found. I want to know is virtual hosting is the right
> way to deal with this issue.? Or can this be done using customised error
> pages.
> 
> Is it possible to customise the 503 / 404 page, so that, for any resource
> not found issue, tomcat displays the customised page. That is if the web
> application is not presents in tomcats web apps directory, tomcat should
> display this customised error page.
> 
>  I found that usually custom error pages are written for a specific web
> application. If some error occurs in  that web application, the error page
> is displayed using that web applications web.xml.
> 
> I want to extend it to whole tomcat.
> I have added the following code in tomcat5.5.12/conf/web.xml after
> welcome file list tab
> 
> <error-page>
>         <error-code>404</error-code>
>         <location>/error404.html</location>
> </error-page>
> 
> Now when I try for a resource that is not available in my tomcat, the
> result is a blank page instead of 404/- default page or my customised
> error404.html. That means the code worked fine but the error404.html is
> not
> found at the right place. I have tried to paste the simple html file that
> many different folders like in tomcat home itself, then in webapps,
server,
> server/webapps/, server/webapps/manager, etc. But the it always returns
> blank page.
> 
>  For simplicity I have used single line to display the error page. the
> code in error404.html is as follows:
> <html>
> <title> 404 resource not found </title>
> <body>
> 
>         This is 404 error page
> 
> </body>
> 
> </html>
>  Can any one please tell where am I going wrong.



---------------------------------------------------------------------
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


Mime
View raw message