Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 75254 invoked from network); 7 May 2002 08:00:31 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 May 2002 08:00:31 -0000 Received: (qmail 12305 invoked by uid 97); 7 May 2002 08:00:24 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 12273 invoked by uid 97); 7 May 2002 08:00:24 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 12250 invoked by uid 98); 7 May 2002 08:00:23 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Content-Type: text/plain; charset="iso-8859-1" From: Raphael Organization: Alpha Centauri To: "Tomcat Users List" Subject: Re: How to add a throw exception to a servlet Date: Tue, 7 May 2002 10:00:53 +0200 X-Mailer: KMail [version 1.4] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205071000.53864.rcicco@alphacent.com> X-Virus-Scanned: by AMaViS X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm late with this reply but thanks! Le Vendredi 03 Mai 2002 12:26, Ion Larranaga a =E9crit : > Hi, > > There's no way to add new exception types to the doPost method. However= , > you could do something like: > > public void doPost(HttpServletRequest request, HttpServletResponse > response) throws ServletException, IOException > { > =09try > =09{ > =09=09/* > =09=09your code > =09=09*/ > =09} > =09catch (SQLException exc) > =09{ > =09=09throw new ServletException(exc); > =09} > } > > This way, the real exception goes nested within a ServletException and = you > don't have to change the method signature. > > Hope it helps, > > Ion > > >But I want the exception to be caught in the error.jsp page, not do a = try > >{...} catch{...} inside the doPost body. > > > >I don't know if I explained it correctly but is there a simple solutio= n to > >this problem ? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE814m1h2ITK4xBkFERAstoAJ9ZvhkOi5ndsMuzBDssBIPGl48lNACfRxXg qDjJ8zUzIyi28j+iMMJBsJs=3D =3DK4I9 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: For additional commands, e-mail: