tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Bogdan <cristianbog...@yahoo.com>
Subject catching exceptions raised in the included servlet
Date Fri, 05 May 2000 11:16:05 GMT
Hello

I have sent this to sun (servlet-api-feedback and
servlet-interest). since I use Tomcat as servlet
container I think it should come here as well:

according to the 2.2 spec, section 8.5

> Only runtime exceptions and checked exceptions of
> type ServletException or
> IOException should be propagated to the calling
> servlet if thrown by the target of a request
> dispatcher.

Does that mean that if I call include(), I should be
able to catch runtime exceptions raised by the called
servlet?

should this try block catch the runtime exception
deliberately raised by the "error" servlet?

try{
     getServletConfig().getServletContext().
     getRequestDispatcher("/servlet/error").
       include(request, response);
} catch (Exception ex) { ex.printStackTrace (); }

This doesn't seem to happen in Tomcat 3.1 (instead,
I see error 500 in included servlet). Should I expect
the catch to happen in the standard?

thanks

Cristian

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Mime
View raw message