I will submit a patch and a testcase once I find out why this fix breaks the "Infinte Recursion Detection" block in ActionChainResult line 206. Everything else seems ok. I simply get a white screen with no response if I infinitely chain to the same action.
I am a bit at loss on this one. Anyone have any ideas ? I am sorry if posting a mostly-xwork issue here is considered spam. But then again, If I remove the struts ExceptionMappingInterceptor >From my interceptor stack, the problem goes away. Kristian -----Opprinnelig melding----- Fra: Rainer Hermanns [mailto:[EMAIL PROTECTED] Sendt: 18. juni 2008 10:07 Til: Struts Developers List Emne: Re: Need verification of complex patch Kristin, could you please attach this as unified patch to the related Jira issue? I'll look into this during the week and apply the patch, if everything is working properly. It would be very helpful, if you have a unit test available, that verifies the correct behaviour. thanks, Rainer > I have a patch for http://jira.opensymphony.com/browse/XW-604 and > another issue that i am experiencing. The patch somewhat changes the > behaviour of the exception flow and I would like a small review: > > Problem I am fixing: > DefaultActionInvocation.invoke() invokes entire interceptor chain and > calls invokeActionOnly with the full chain on the stack. > invokeActionOnly returns success. > executeResult is invoked and throws an exception (in XW-604 it is > "beforeResult" that throws an exception but with the same effect.) > Call stack unwinds to ExceptionMappingInterceptor. > When ExceptionMappingInterceptor completes, executed is actually > FALSE in the DefaultActionInvocation, meaning that executeResult will > be invoked *again* (with exception again). > The stacktrace that flows to the top is actually from the last > exception, and the symptom is that there are no interceptors on the > stacktrace. > > My patch is really very simple, i just moved executed=true to the top > of the block, like this: > > // this is needed because the result will be executed, then > control will return to the Interceptor, which will > // return above and flow through again > if (!executed) { > executed = true; // Flag as executed, no matter what > happens below. // THIS IS THE PATCH. Used to be at the bottom of the > if block. > > if (preResultListeners != null) { > for (Iterator iterator = > preResultListeners.iterator(); > iterator.hasNext();) { > PreResultListener listener = > (PreResultListener) iterator.next(); > > String > _profileKey="preResultListener: "; > try { > > UtilTimerStack.push(_profileKey); > > listener.beforeResult(this, resultCode); > } > finally { > > UtilTimerStack.pop(_profileKey); > } > } > } > > // now execute the result, if we're supposed to > if (proxy.getExecuteResult()) { > executeResult(); > } > } > > > > > I believe there are no thread safety issues here. > > Comments ? > > Kristian Rosenvold > -- Rainer Hermanns aixcept Mariahilfstrasse 9 52062 Aachen - Germany w: http://aixcept.de/ t: +49-241-4012247 m: +49-170-3432912 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]