originally posted by Adeel Ansari
- forward to error page from your servlet using RequestDispatcher. Or make an error page entry in your deployment descriptor. Both would work fine.
1.If you use RequestDispacther to forward to an 'jsp error page' then you have to set the request attribute as
request.setAttribute("java.servlet.jsp.jpsException",e) and then forward('e' is your exception object). Advantage of doing so is can get the exception object in your error page too as the jsp implicit object 'exception'. Then you do stack trace or handle it in your way.
2.If you use deployment descriptor then it works fine and is easier.
Nikhil Kanjulli Menon