I get jsp exceptions causing a forward to my error page when I put this at the top of my JSPs...
<%@ page errorPage="/error.page" %>
but when I try to do it globally with web.xml like so:
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error.page</location>
</error-page>
I just get a blank page... I've also tried putting /error.jsp in the location element.. but no love with that either..
I am triggering an exception with a jsp that just contains this:
<%if(true)throw new RuntimeException("test exception");%>
I do see the exception in the console from tomcat but I just can't get that error page to show without a directive on every jsp... am I missing something simple here?
UPDATE:
/error.page is mapped (using spring) the contents are this:
<%@ page isErrorPage="true"%>
<html>
<head></head>
<body>
<div class="error">
An error has occurred, the development team has been notified. Sorry for the inconvenience.
</div>
</body>
</html>
I can hit the page directly with no error.
UPDATE:
If you have this problem... make sure you don't have filters swallowing exceptions in your chain! see my answer below.