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-fi
le>
<welcome-file>index.htm</w
elcome-fil
e>
<welcome-file>index.jsp</w
elcome-fil
e>
</welcome-file-list>
<error-page>
<error-code>404</error-cod
e>
<location>/Failure.jsp</lo
cation>
</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</locati
on>
Any help is greatly appreciated.
- Rich
Start Free Trial