Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 98513 invoked from network); 1 Jun 2000 03:17:43 -0000 Received: from pluto.ipass.net (198.79.53.5) by locus.apache.org with SMTP; 1 Jun 2000 03:17:43 -0000 Received: from u25nv (ppp-1-54.dialup.rdu.ipass.net [209.170.132.54]) by pluto.ipass.net (8.9.3/8.9.3) with SMTP id XAA15813 for ; Wed, 31 May 2000 23:17:39 -0400 (EDT) Message-ID: <002301bfcb78$6f657f60$3684aad1@u25nv> From: "Phil Hanna" To: Subject: Throwing exceptions from jspInit Date: Wed, 31 May 2000 23:21:10 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01BFCB56.E7A724A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0020_01BFCB56.E7A724A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable In the JSP 1.1 environment, you can no longer override the init() = method, but instead you can override jspInit(), which is called = automatically: =20 final public void init(ServletConfig config) throws ServletException { this.config =3D config; jspInit(); } =20 My question is, if you detect an error in jspInit(), how are you = supposed to throw an exception (like UnavailableException or ServletException)? You can't change the jspInit() signature, which is = simply =20 public void jspInit() =20 with no exceptions. And init() is final, so you can't change that.=20 =20 Is this a hole in the spec? =20 ------=_NextPart_000_0020_01BFCB56.E7A724A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
In the JSP 1.1 environment, you can no longer = override=20 the init() method, but instead you can override jspInit(), which is = called=20 automatically:
 
final public void init(ServletConfig config) = throws=20 ServletException {
   this.config =3D = config;
  =20 jspInit();
}
 
My question is, if you detect an error in=20 jspInit(), how are you supposed to throw an exception (like = UnavailableException=20 or
ServletException)?  You can't change the jspInit() signature, = which=20 is simply
 
public void jspInit()
 
with no=20 exceptions.  And init() is final, so you can't change that.=20
 
Is this a hole in the=20 spec?
 
------=_NextPart_000_0020_01BFCB56.E7A724A0--