Re: displaying customized error page in tomcat 5.5.12
Dear Len Popp, Thanks for the mail. On 5/19/07, Len Popp [EMAIL PROTECTED] wrote: That doesn't work for me. The ErrorDocument 503 declaration in httpd.conf only works when Tomcat is completely down, not when a single webapp is stopped or reloading. As long as Tomcat is running, you'll get Tomcat's error pages. And, you can't override this in Tomcat's conf/web.xml, only in each webapp's web.xml, which makes it impossible to customize the 503 page. :-( (I've tested all this with Tomcat 5.5, Apache web server 2.0, JK 1.2. Maybe it's different with Tomcat 6 or Apache 2.2.) -- Len On 5/18/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 3:54 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 You are right Tim, How I came to know about this might explain why ! I changed my war file to ROOT.war as this is situation in our website's tomcat. Now when I go to localhost:8080/ my application is displayed properly something like localhost:8080/eApp gives the custom 404 page I designed and placed in newly renamed ROOT folder. But When I am trying to reload my root using manager/html and at the same time trying to access localhost:8080/, tomcat do not show custom page rather it sends a blank page. So, is apache web server is the only option left for me ?? can virtual hosting be used here ?? I don't know. I use ErrorDocument 503 /maintenance.html ErrorDocument 404 /404.html in my httpd.conf and httpd sends the custom error page for me. Maybe someone else can offer you a different solution. Tim Thanks and Regards: Quayum Sagri On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.htmlfor more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED
Re: displaying customized error page in tomcat 5.5.12
That doesn't work for me. The ErrorDocument 503 declaration in httpd.conf only works when Tomcat is completely down, not when a single webapp is stopped or reloading. As long as Tomcat is running, you'll get Tomcat's error pages. And, you can't override this in Tomcat's conf/web.xml, only in each webapp's web.xml, which makes it impossible to customize the 503 page. :-( (I've tested all this with Tomcat 5.5, Apache web server 2.0, JK 1.2. Maybe it's different with Tomcat 6 or Apache 2.2.) -- Len On 5/18/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 3:54 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 You are right Tim, How I came to know about this might explain why ! I changed my war file to ROOT.war as this is situation in our website's tomcat. Now when I go to localhost:8080/ my application is displayed properly something like localhost:8080/eApp gives the custom 404 page I designed and placed in newly renamed ROOT folder. But When I am trying to reload my root using manager/html and at the same time trying to access localhost:8080/, tomcat do not show custom page rather it sends a blank page. So, is apache web server is the only option left for me ?? can virtual hosting be used here ?? I don't know. I use ErrorDocument 503 /maintenance.html ErrorDocument 404 /404.html in my httpd.conf and httpd sends the custom error page for me. Maybe someone else can offer you a different solution. Tim Thanks and Regards: Quayum Sagri On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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
Re: displaying customized error page in tomcat 5.5.12
You are right Tim, How I came to know about this might explain why ! I changed my war file to ROOT.war as this is situation in our website's tomcat. Now when I go to localhost:8080/ my application is displayed properly something like localhost:8080/eApp gives the custom 404 page I designed and placed in newly renamed ROOT folder. But When I am trying to reload my root using manager/html and at the same time trying to access localhost:8080/, tomcat do not show custom page rather it sends a blank page. So, is apache web server is the only option left for me ?? can virtual hosting be used here ?? Thanks and Regards: Quayum Sagri On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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-code404/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
RE: displaying customized error page in tomcat 5.5.12
-Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 3:54 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 You are right Tim, How I came to know about this might explain why ! I changed my war file to ROOT.war as this is situation in our website's tomcat. Now when I go to localhost:8080/ my application is displayed properly something like localhost:8080/eApp gives the custom 404 page I designed and placed in newly renamed ROOT folder. But When I am trying to reload my root using manager/html and at the same time trying to access localhost:8080/, tomcat do not show custom page rather it sends a blank page. So, is apache web server is the only option left for me ?? can virtual hosting be used here ?? I don't know. I use ErrorDocument 503 /maintenance.html ErrorDocument 404 /404.html in my httpd.conf and httpd sends the custom error page for me. Maybe someone else can offer you a different solution. Tim Thanks and Regards: Quayum Sagri On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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
Re: displaying customized error page in tomcat 5.5.12
Thank you very much for your time and knowledge. I am trying virtual hosting, If I get it, I will mail you. Regarsd: Sagri On 5/18/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Friday, May 18, 2007 3:54 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 You are right Tim, How I came to know about this might explain why ! I changed my war file to ROOT.war as this is situation in our website's tomcat. Now when I go to localhost:8080/ my application is displayed properly something like localhost:8080/eApp gives the custom 404 page I designed and placed in newly renamed ROOT folder. But When I am trying to reload my root using manager/html and at the same time trying to access localhost:8080/, tomcat do not show custom page rather it sends a blank page. So, is apache web server is the only option left for me ?? can virtual hosting be used here ?? I don't know. I use ErrorDocument 503 /maintenance.html ErrorDocument 404 /404.html in my httpd.conf and httpd sends the custom error page for me. Maybe someone else can offer you a different solution. Tim Thanks and Regards: Quayum Sagri On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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
Re: displaying customized error page in tomcat 5.5.12
Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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-code404/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: displaying customized error page in tomcat 5.5.12
-Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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-code404/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying customized error page in tomcat 5.5.12
Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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-code404/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: displaying customized error page in tomcat 5.5.12
That will work, but only if the root (/) context is available and running. This may or may not solve some or all of your problem(s). Tim -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:08 PM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim, Thanks for that explanation. We are not using any web server, so, I cannot configure in httpd file. I resolved the problem using the same error-page tag. I have placed my custom error page in webapps/ROOT directory. Thanks for your support. On 5/17/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Abdul Qayyum [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 2:01 AM To: Tomcat Users List Subject: Re: displaying customized error page in tomcat 5.5.12 Hi Tim Lucia, 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. This is my target. If my tomcat recieves a context which is not in my tomcat, it should send customised page. And this is applicable to all the apps on server. What can be the reason for it, not working for me? I don't know. I've never tried it. You'll have to give specific reasons why it's not working, including configuration files as appropriate. I did this via httpd. Please Let me know WHAT IS FRONTING with httpd. please give me any links if you have for that. how to front my tomcat with httpd. Also I do not have any file named httpd.conf in my tomcat. I meant using Apache's httpd web server in front of Tomcat, connecting the two via mod_jk or mod_proxy. See http://tomcat.apache.org/connectors-doc/reference/apache.html for more ideas. In this case, I do send a custom 404 from httpd, regardless of whether it was local or came from Tomcat. Tim Thank you very much. On 5/16/07, Tim Lucia [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED] 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-code404/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
RE: displaying customized error page in tomcat 5.5.12
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:[EMAIL PROTECTED] 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-code404/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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]