Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 58926 invoked from network); 6 Feb 2001 00:53:17 -0000 Received: from mercury.sun.com (192.9.25.1) by h31.sny.collab.net with SMTP; 6 Feb 2001 00:53:17 -0000 Received: from taller.eng.sun.com ([129.144.125.34]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id QAA19789 for ; Mon, 5 Feb 2001 16:53:24 -0800 (PST) Received: from eng.sun.com (d-ucup02-251-159 [129.144.251.159]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v2.0) with ESMTP id QAA19281 for ; Mon, 5 Feb 2001 16:53:23 -0800 (PST) Message-ID: <3A7F4B87.14AC448@eng.sun.com> Date: Mon, 05 Feb 2001 16:55:35 -0800 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.76 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: RequestDispatcher and exceptions References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N cmanolache@yahoo.com wrote: > > > > In Tomcat 4, the following rules are applied: > > > > * If the included servlet throws ServletException or IOException, > > > > propogate it on to the calling servlet (i.e. no error page behavior). > > > > * If the included servlet throws any other exception (such as > > > > NullPointerException), wrap it in a ServletException and propogate > > > > that to the calling servlet (i.e. no error page behavior). > > > > > > Great, I'll do something similar in tomcat3.3. > > > > > > My only issue is with the special treatement of RuntimeExceptions - is > > > there a need to wrap them with ServletException ? I would treat > > > included servlets in the same way as "normal" servlets ( from error > > > handling perspective). > > > > > > > Just the spec requirement (Section 8.5 for 2.3 PFD; I'm sure the 2.2 spec had a > > similar statement. > > ??? > > Section 8.5 in 2.3 PFD says: > "Only runtime exceptions and checked exceptions of type ServletException > and IOException should be propagated ... if thrown by the target of > RequestDispatcher. All other exceptions should be wrapped ... " > > My understanding of this is that NullPointerException should be > propagated, not wrapped, same for security and any other RuntimeException. > Mea culpa. Costin's interpretation is correct (I was too focused on the "checked exceptions" part of the statement quoted above), and Tomcat 4 is currently broken in this respect. That will get changed tonight. > > Costin > Craig