keep ur whole doGet/doPost/service method in a
try-catch block.
ur catch block should be something like this:
catch (Exception ex){
response.setAttribute("�javax.servlet.jsp.jspException�,
ex);

Then forward the request using
requestDispatcher.forward() to ur errorPage.jsp

}

In ur errorPage.jsp the implicit "exception"  should
be availible, and u can handle ur exception anyway u
like.

Make sure that after forwarding ur request to the
Error page no other statements are executed in ur
doGet/doPost

This is more or less how the  servlet generated from a
compiled JSP page implements errorPage logic.


--- kavitha ramasamy <[EMAIL PROTECTED]>
wrote:
> Hello,
>
>    In JSP, if any error occurs, instead of showing
> that page, we can dispaly
> the customized user error page like
> errorPage="Error.jsp"
>
>    How to implement the same in servlet without
> using trycatch for unknown
> errors and exceptions.
>
> Kavitha
>
>
________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at
> http://www.hotmail.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
>
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
>
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help:
http://www.lsoft.com/manuals/user/user.html


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to