By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,728 Members | 753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,728 IT Pros & Developers. It's quick & easy.

Broken? <error-page> in web.xm under tomcat 4.x

P: n/a
Hello,

I am running Tomcat 4.x and have tried to set global error handling
using the following kind of entries in the web.xml file. But there is
no redirection and I always end up with the tomcat generated error
page in the browser.

Does anyone have a solution to this problem?

<error-page>
<error-code>500</error-code>
<location>/weberror.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/weberror.jsp</location>
</error-page>

Thanks

Bruce Sams
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
From the servlet specification:

"The error page mechanism described does not intervene when errors
occur in
servlets invoked using the RequestDispatcher."

Do you use Struts? With Struts, the request is *dispatched* to JSP
page, therefore you will not see the error page set up in web.xml. Try
accessing your JSP page without going through the action servlet, so
instead of typing http://localhost:8080/myapp/test.do, type
http://localhost:8080/myapp/test.jsp. You can use <global-exceptions>
in struts-config.xml to achieve what you tried to do with <error-page>
in web.xml.

Jonni Gani

bj**@yahoo.com (Bruce Sams) wrote in message news:<1b**************************@posting.google. com>...
Hello,

I am running Tomcat 4.x and have tried to set global error handling
using the following kind of entries in the web.xml file. But there is
no redirection and I always end up with the tomcat generated error
page in the browser.

Does anyone have a solution to this problem?

<error-page>
<error-code>500</error-code>
<location>/weberror.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/weberror.jsp</location>
</error-page>

Thanks

Bruce Sams

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.