Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 5921 invoked from network); 25 Aug 2009 17:21:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Aug 2009 17:21:11 -0000 Received: (qmail 75578 invoked by uid 500); 25 Aug 2009 17:21:33 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 75544 invoked by uid 500); 25 Aug 2009 17:21:33 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 75534 invoked by uid 99); 25 Aug 2009 17:21:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 17:21:33 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of greg.lindholm@gmail.com designates 74.125.78.27 as permitted sender) Received: from [74.125.78.27] (HELO ey-out-2122.google.com) (74.125.78.27) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 17:21:22 +0000 Received: by ey-out-2122.google.com with SMTP id 22so733754eye.11 for ; Tue, 25 Aug 2009 10:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ERnJuQOm+pCoipIrgXmd/IexWaqSkzxRbQPZWgLvH3Q=; b=bLVpHmw39FwFWQ74vfwrr9Dl2Dcmbxj5vNdP4ZHnDHolzZ0rlj/hH3CHEnnkolhz7c IIG6cGkoicMv8qnErFksBWm3mMNC9VT3MnxmC36VWgc85KHSZlQhMsxlOD+Ml8FsMoJo MQdrfumHr6qFt1SG4HrmTaNXiifiQyBN0eRqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fIA6wPrVmyD0SEfTZqpf1bX4gzZFjp0UJWcwHBJJH6Ot3Sg21vMhMrVgGu2/ezs26p thTLXRhLcPD8GF1tmCE2RsrVlaAsVPGJ+3X4C3Sgd6XikP/xDOMIF16e3xBUR4ZmEi7o uvNhnpSmYb509K7wZOeS6RV0uM3yisw1dabAY= MIME-Version: 1.0 Received: by 10.216.18.205 with SMTP id l55mr1358773wel.194.1251220860939; Tue, 25 Aug 2009 10:21:00 -0700 (PDT) In-Reply-To: <634970.32732.qm@web30401.mail.mud.yahoo.com> References: <634970.32732.qm@web30401.mail.mud.yahoo.com> Date: Tue, 25 Aug 2009 13:21:00 -0400 Message-ID: <74a2042d0908251021m4e31410fo6f851ed59aca3226@mail.gmail.com> Subject: Re: how to get exception stack after redirect to action From: Greg Lindholm To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=0016e64c2740f3af700471fa8ed5 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64c2740f3af700471fa8ed5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The exception will not persist across the redirect unless you were to save it in the session. If you want to do this then you could take a look at [1] RedirectMessageInterceptor for an example of how to saveand retrieve the exception in the session. However, what I do to handle exceptions is have a global result "error" which just goes to a jsp page. /struts/Error.jsp In the Error.jsp page I use some ognl to call a method "notifyAdmiin()" and pass it the exception. <%-- Dummy expression to notify the admin --%> I can than do any handling of the exception in my notifyAdmin() method, this method is in my base Action class so is available from all actions. [1] http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/ On Tue, Aug 25, 2009 at 12:43 PM, Louis Voo wrote: > Hi, > > What I'm trying to do is when exception happen, it redirect to > ExceptionHandlingAction and do something extra like sending email. My > question are > 1) How to get the exception in ExceptionHandlingAction ? I've this setter > in the action public void setException(Exception exception), but nothing is > set > 2) How to get the original request? I want to print out all the request > parameters which user submit. > 3) If I use result type "chain" I got this error message: > Infinite recursion detected: > [/exception/exception!execute, > /exception/ExceptionHandling, /exception/ExceptionHandling] > - [unknown location] > > > Here is my configuration: > > > ExceptionHandling > /WEB-INF/pages/error/Error.jsp > > > > result="errorAction" /> > > class="demo.action.ExceptionHandlingAction"/> > > > > Thanks > Louis --0016e64c2740f3af700471fa8ed5--