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:
<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/queryException.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
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.jsp 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?