tags:

views:

64

answers:

1

I need to have a default error JSP page which is shown when an exception is thrown by the servlet, and that page will show the stacktrace..

How do I do that?? is there a right technique (provided by the API) or I have to do it manually?? I mean, sending the exception thrown as an attribute and then dealing with it by myself??

Thanks

+2  A: 

You can configure the exception type and the JSP page to handle in web.xml, e.g:

<error-page>
       <exception-type>UnhandledException</exception-type>
       <location>UnhandledException.jsp</location>
</error-page>

There's an Oracle article here on the subject:

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/servlets/HandlingServletExceptions/HandlingServletExceptions.html

Jon
I've done that many times, but it doesn't work.Going to read the link you provided.Thank you.
Juan Diego