you might possibly be breaking the one action class design of Struts is there anything in the 2nd Action class which will not be accomodated by the first class?
right now its simple to look at the interceptor stack and determine which class is being called in what order..although technically possible to create any other class (Spring accomplishes this DI functionality thru Spring configured Factories) you would need a reason to justify a change in flow: Specifically: 1a)Which updated/new attributes would the new Action class contain? 1b)Can we not accomodate the new Action attributes in the original Action Class? 2a)Which updated/new methods would the new Action class contain? 2b)Can we not accomodate these new Action methods in the original Action Class? 3a)Which context (element and attribute) params would be introduced by the new class? 3b)Can we not accomodate these new Context Params in the original Action Context? What happens when this new class abends..how do you debug? (my concern is obfuscation of flow or process can lead to confusion in implementation) What say ye Musachy? Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: st...@sjlt.co.uk > To: user@struts.apache.org > Subject: RE: Struts2 Interceptor > Date: Wed, 27 May 2009 10:47:42 +0100 > > Hi Stefano, > > This looks like an awkward design as you would go through half the > interceptor stack expecting to call one action, and half the stack expecting > to call a second action. > > As an alternative could you do something like the following:- > > Create class (or Interface) ReceivingAction with sub classes as the > "actions" you want to assign dynamically. > > Create a true action class ForwardingAction with a property ReceivingAction. > > The interceptor can now dynamically create the class required (derived from > / implementing ReceivingAction) and set it on the current action > (ForwardingAction). It could also place the ReceivingAction instance on the > ValueStack. > > The main action methods you are interested in (e.g. execute) could simply > forward to the ReceivingAction instance. You will need to be careful about > interceptor order if you want to do things like set your parameter values on > your ReceivingAction. > > I haven't implemented this myself, although I have implemented all the > techniques I have described. I'm fairly confident that this will achieve > what you want. > > Cheers, > > Steve > > -----Original Message----- > From: Stefano Corallo [mailto:stefan...@gmail.com] > Sent: 27 May 2009 07:54 > To: user@struts.apache.org > Subject: Struts2 Interceptor > > Hi all, > > can an interceptor call an arbitraty action different from the action > requested by the client? > > Suppose i've the interceptor "interceptor-router" placed in the stack and > the client call MyAction.action, when the interceptor intercept the call is > possible to 'redirect' the call to MyDifferentAction.action from the > interceptor? > > I've seen that there is action chaining but this require to know at build > time the name of the actions i want to redirect to, but i know the name only > at runtime and > > > I hope i was clear :) sorry for my english. > > > -- > Stefano Corallo > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009