Advertisement

06.22.2004 at 12:07AM PDT, ID: 21033571
[x]
Attachment Details

Tomcat 404 redirect problem

Asked by atomicfalls in Application Servers

Tags: tomcat, redirect, 404

I created a "Failure.jsp" page and placed it in my webapp directory. I then added the error redirection code displayed below to my /tomcat_home/conf/web.xml file.

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

<error-page>
  <error-code>404</error-code>
  <location>/Failure.jsp</location>
</error-page>

</web-app>

When I restart Tomcat and try to access my webapp I get a standard tomcat 404 response, regardless of whether the page I'm trying to access actually exists or not. If remove the <error-page> tags from the web.xml and restart Tomcat everything works fine. What am I missing?  It may be relevant that I'm using the invoker servlet in my configuration. I'm running tomcat in stand alone. Also, I've tried this on both Tomcat 4 and 5 versions with the same result. I also get the same result if I create a simple web.xml file containing the <error-page> tags and place it within my webapps WEB-INF directory. Ideally I would like to redirect all 404 errors to an offsite page as in   <location>http://mysite.com/error.html</location>

Any help is greatly appreciated.

- Rich
Start Free Trial
[+][-]06.22.2004 at 02:12AM PDT, ID: 11367278

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.22.2004 at 11:22PM PDT, ID: 11376588

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2004 at 03:24AM PDT, ID: 11387326

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Application Servers
Tags: tomcat, redirect, 404
Sign Up Now!
Solution Provided By: vzilka
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.27.2004 at 10:21AM PDT, ID: 11648664

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.31.2004 at 06:28AM PDT, ID: 11684079

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32