Thanks, that was just what I was looking for (somehow I overlooked this in the documentation..)
Just as an additional note:
When I set this up, it initially created a circular reference that kept the browser forwarding constantly between two pages:
my "index.jsp" itself does a forwarding to another page (after checking the version of the browser). Now, the funny thing is that the error page defined in Tomcat comes up, but the URL is still the one of the original page that the user typed in. So the forward tries to forward (which uses a relative link) to another page that does not exist, which calls up the error page (index.jsp) again, which forwards to the non-existent page, etc.
So the solution was to create a page called Error404.jsp in the root of every site and use that as the error page. This page would do a forward to "/index.jsp" as an ABSOLUTE link, so that the URL actually gets replaced.
Main Topics
Browse All Topics





by: fargoPosted on 2003-06-20 at 07:10:12ID: 8766639
Hii,
e> ation>
The best way is to add the following in the web.xml for the context.
<error-page>
<error-code>404</error-cod
<location>/index.html</loc
</error-page>
U can refer the tomcat 4 documentation for more details on this.
Hope this helps
regards
fargo