tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Héritier <aherit...@sopra.com>
Subject RE: Servlets and JSP Error Pages
Date Mon, 01 Oct 2001 13:45:08 GMT
It's not a really clean solution but you can do it like this :

try{
.....
}catch(Exception e){
    RequestDispatcher rd = getServletContext().getRequestDispatcher("MyErrorPage.jsp");
    request.setAttribute("javax.servlet.jsp.jspException", e);
    rd.forward(request, response);
}

I tested it and it works.

arno

> -----Message d'origine-----
> De:	Brendan McKenna [SMTP:mckennab@taringold.ie]
> Date:	lundi 1 octobre 2001 15:35
> À:	tomcat-user@jakarta.apache.org
> Objet:	Servlets and JSP Error Pages
> 
> Hi,
> 
> 	Is there a way to route exceptions thrown in servlets to a JSP 
> error page?
> 
> 
> 						Brendan
> -- 
> Brendan McKenna			       Email: brendan.mckenna@taringold.ie
> Development Strategist		       Phone: +353-61-338177
> Taringold Ltd.			       Fax:   +353-61-338065
> 


Mime
View raw message