You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cristian Bogdan <cr...@yahoo.com> on 2000/05/05 13:14:53 UTC

catching exceptions raised in the included servlet

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/