I have this problem: I set the dafault error page in the web.xml file like java.lang.Exception, so it should be displayed in all exceptions in servlets and jsp. But when I want to test this page (I will disconnect the connection), it does not work in the browser. in a tested servlet I use a database, so if there is no connection, it will throw an exception. In the servlet I will catch this exception and throw new ServletException(). also in the catch block, I first log the message and then throw an exception. So why is my tomcat not showing this error page? Instead, it shows a blank page and on the server output I can see these error messages
change
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errorPages/InternalError.jsp</location>
</error-page>
i save the error pages to / errorPages and the page to be displayed with the name InternalError.jsp
This page should be displayed after going to the jsp page that uses El to display data from the database, which in this jsp fall throw an object that is in the session
maks source
share