Hi, I'm trying to define an error-page in web.xml like <error-page> <exception-type>MyException</exception-type> <location>/jsp/errorpage.jsp</location> </error-page> In my servlet code, doGet throws a MyException (which extends ServletException). I really thought this should go well, but a HTTP 500 - Internal Server error is created. Is there something wrong in my approach, or what? TIA, Ruud.
I believe you need to provide the fully qualified exception, with package:
Of course, if you're exception isn't in a package, that won't apply.
posted 17 years ago
yeah, i know, but that wasn't the problem. problem was that i was using exception.getMessage() However, the exception is not available as it is in the jsp errorpage. I have to retrieve the exception from the request via the request.getAttribute("javax.servlet.error.something");