Tomcat Exception-Type Ignoring Specific Exception for More General
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</ex开发者_如何学Pythonception-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?
"What is the solution here? How can I keep a general error page for all exceptions EXCEPT for those with specific pages?"
You are not able to do this...You will need to move in a direction other than a general error page for all your exceptions.
精彩评论