Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 19143 invoked from network); 4 Jul 2005 11:49:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jul 2005 11:49:23 -0000 Received: (qmail 8919 invoked by uid 500); 4 Jul 2005 11:49:00 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 8901 invoked by uid 500); 4 Jul 2005 11:49:00 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 8886 invoked by uid 99); 4 Jul 2005 11:48:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2005 04:48:59 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: error (asf.osuosl.org: local policy) Received: from [195.172.82.137] (HELO mail1.qas.com) (195.172.82.137) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2005 04:49:01 -0700 Received: from orion.qas.com (orion.qas.com) by mail1.qas.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Mon, 4 Jul 2005 12:48:31 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Handling exceptions declaratively Date: Mon, 4 Jul 2005 12:48:31 +0100 Message-ID: <5684A7E6FB10504393A2806C1F4C021005AF8C90@orion.qas.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Handling exceptions declaratively Thread-Index: AcWAjMp7vBFHxCAyQ1uBlCmDnBTJnAAASaFA From: "Allistair Crossley" To: "Tomcat Users List" , "Carlos Bracho" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, doPost/doGet throw ServletException. I think the problem lies in that you a= re wrapping your exception but this does not translate to the exception act= ually being "of class" UserNotFoundException. You'd need to actually throw = your own exception which could extend ServletException for example. Cheers, Allistair. > -----Original Message----- > From: Carlos Bracho [mailto:carlos.bracho@gmail.com] > Sent: 04 July 2005 12:37 > To: tomcat-user@jakarta.apache.org > Subject: Handling exceptions declaratively >=20 >=20 > Hello everybody. >=20 > I am trying to handling exceptions declaratively, here is=20 > part of my the=20 > web.xml file: >=20 >=20 > >=20 > ladw.model.UserNotFoundException >=20 > /error.jsp >=20 > >=20 > >=20 > ladw.model.IlegalAccessException >=20 > /error.jsp >=20 > >=20 > >=20 > ladw.model.InvalidFileNameException >=20 > /error.jsp >=20 > =20 >=20 > >=20 > testServlet >=20 > ladw.controller.testServlet >=20 > >=20 > >=20 > testServlet >=20 > /testServlet >=20 > >=20 >=20 > I created a test servlet with the following code: >=20 >=20 > /* >=20 > * testServlet.java >=20 > * >=20 > * Created on 3 de julio de 2005, 03:17 PM >=20 > */ >=20 > package ladw.controller; >=20 >=20 > import java.io.*; >=20 > import java.net.*; >=20 > import ladw.model.UserNotFoundException; >=20 > import javax.servlet.*; >=20 > import javax.servlet.http.*; >=20 > public class testServlet extends HttpServlet { >=20 > protected void doGet(HttpServletRequest request, HttpServletResponse=20 > response) >=20 > throws ServletException, IOException { >=20 > throw new ServletException("Wrapped UserNotFoundException",new=20 > UserNotFoundException());=20 >=20 > } >=20 > protected void doPost(HttpServletRequest request, HttpServletResponse=20 > response) >=20 > throws ServletException, IOException { >=20 > } > =20 > } >=20 > When I write this urL http://localhost:8080/LADW/testServlet=20 > in my browser=20 > I got the follow error: >=20 > ladw.model.UserNotFoundException: User does not exist >=20 > ladw.controller.testServlet.doGet(testServlet.java:28) >=20 > javax.servlet.http.HttpServlet.service(HttpServlet.java:697) >=20 > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) >=20 > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter( > MonitorFilter.java:362) >=20 > What is wrong in the error pages declaration??? why the=20 > error page does not=20 > appear? >=20 > --=20 > ------------------------------------------------------------------ > Carlos J, Bracho M.=20 > ------------------------------------------------------------------ > e-mail: carlos.bracho@gmail.com > MSN: cbrachomi@hotmail.com > +58 416 409 21 75=20 > ------------------------------------------------------------------ >=20 =20 ------------------------------------------------------- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 ------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org