I have a such problem: i've set the dafault error page in web.xml on java.lang.Exception type, thus it has to be shown on all exceptions in servlets and jsp. But when I want to test this page(I turn off the connection) it doesn't apper in the browser. in tested servlet I use database, so if there is no connection it will throw an exception. In servlet I catch this exception and throw new ServletException()
. also in catch block at first I log the message and then throw an exception. So why my tomcat doesn't show this error page? Instead of this it show blank page and in server output I can see these error messages
edit
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errorPages/InternalError.jsp</location>
</error-page>
i save error pages in /errorPages and the page that have to be shown called InternalError.jsp
This page has to be shown after moving to the jsp page which is using El to show data from database which in that jsp fall throw object that is in session