From dev-return-55599-apmail-struts-dev-archive=struts.apache.org@struts.apache.org Fri Oct 05 01:53:22 2007 Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 84244 invoked from network); 5 Oct 2007 01:53:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 01:53:19 -0000 Received: (qmail 25286 invoked by uid 500); 5 Oct 2007 01:53:07 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 25249 invoked by uid 500); 5 Oct 2007 01:53:06 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 25238 invoked by uid 99); 5 Oct 2007 01:53:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 18:53:06 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [66.249.82.230] (HELO wx-out-0506.google.com) (66.249.82.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 01:53:07 +0000 Received: by wx-out-0506.google.com with SMTP id s14so386541wxc for ; Thu, 04 Oct 2007 18:52:45 -0700 (PDT) Received: by 10.70.41.20 with SMTP id o20mr18241075wxo.1191549165626; Thu, 04 Oct 2007 18:52:45 -0700 (PDT) Received: by 10.70.52.18 with HTTP; Thu, 4 Oct 2007 18:52:45 -0700 (PDT) Message-ID: <436d9a250710041852qf036c57v431915bb3d8f789c@mail.gmail.com> Date: Fri, 5 Oct 2007 11:52:45 +1000 From: "Don Brown" To: "Struts Developers List" Subject: Re: struts/xwork patch submission. Please Review. In-Reply-To: <13020278.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13008842.post@talk.nabble.com> <13014849.post@talk.nabble.com> <13020278.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org The ticket has been fixed. Basically, the patch provided would have broken another feature, so I fixed it in such a way that everyone wins. I didn't put it in 2.1 as I'd like to see it get more testing before going in a stable branch, but if someone else reviews the change and is ok with it, feel free to backport it. Don On 10/4/07, MassimoH wrote: > > Yes, that is the exact same issue and fix. > > I take it that this issue wasn't high enough priority to be included in > previous xwork patch releases? > > > Aymeric Levaux wrote: > > > > I reported a similar issue in Xwork JIRA months ago : > > http://jira.opensymphony.com/browse/XW-521 > > The fix is identical. > > > > -- > > Aymeric > > > > PS: I'm not able to reply threads from my mail account, they're just > > ignored (no errors). Any suggestions? > > > > > > MassimoH wrote: > >> > >> I've isolated a Struts 2 bug and I would like to suggest a code fix. The > >> code fix is in an xwork class. I'm don't fully understand the > >> xwork/struts distinction, but I assume I'm posting to the right list. > >> > >> Here is the error scenario: > >> > >> - DefaultActionInvocation calls all Interceptors which wind onto the Java > >> call stack. Then DefaultActionInvocation calls the actual action itself. > >> The action returns "success" > >> - DefaultActionInvocation creates result object from this result code and > >> executes the result > >> - There is a problem in my FTL template, so FreeMarker throws a > >> ParseException > >> - Call stack unwinds to ExceptionMappingInterceptor which catches the > >> exception, adds to OGNL value stack and returns "unhandledException" > >> - DefaultActionInvocation simply re-executes the already created result > >> object based on the original Action result. > >> - The caching mechanism within FreeMarker detects a current timestamp and > >> will either throw a FileNotFoundException (if the page isn't cached) or > >> returns cached and out-of-date results. In either case, the original > >> exception is lost and never logged. My exception action is also never > >> executed. > >> > >> This seems to be... > >> > >> A small FreeMarker bug: it should rethrow ParseException when called a > >> second time. > >> A larger Struts 2 (or xwork) bug: Struts shouldn't ignore the first > >> exception and simply rerun the result object. When Struts catches the > >> original exception from the result, it should call the defined exception > >> action. > >> > >> > >> I suggest that the following three lines be removed from > >> DefaultActionInvocation.java, line 174: > >> > >> if (result != null) { > >> return result; > >> } > >> > >> I've tested this and I get the desired behavior. My exception action is > >> called for the original exception. The xwork build reports no additional > >> automated test failures. I got four test failures trying to build the > >> standard xwork 2.0.4 distribution before making any changes, however my > >> code change didn't affect these results. > >> > >> > >> Version Info > >> Java 1.6.0_02 > >> Struts 2.0.9 > >> xwork 2.0.4 > >> > > > > > > -- > View this message in context: http://www.nabble.com/struts-xwork-patch-submission.-Please-Review.-tf4558415.html#a13020278 > Sent from the Struts - Dev mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org > For additional commands, e-mail: dev-help@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org