Tomcat Exception-Type Ignoring Specific Exception for More General

Posted by David Marks on Stack Overflow See other posts from Stack Overflow or by David Marks
Published on 2010-04-13T20:11:40Z Indexed on 2010/04/13 20:13 UTC
Read the original article Hit count: 411

Filed under:
|
|

For one type of exception, IOException, I want to display one page. For all other exceptions I have a default error page. In my web.xml I have things setup like this:

java.io.IOException /queryException.jsp

java.lang.Exception /error.jsp

The problem is the error.jsp is the only page that ever shows, even if an IOException is thrown. The order the tags appear in doesn't matter; if I remove the java.lang.Exception tag though, I can get queryException to show for IOExceptions. What is the solution here? How can I keep a general error page for all exceptions EXCEPT for those with specific pages?

© Stack Overflow or respective owner

Related posts about tomcat

Related posts about website