No need for pity :) It really hasn't really much maintenance overhead to this point. Needing to do a change to all stacks is really the only case where I've seen it be problem. Still, we have been pretty conservative in trying to keep our interceptor stacks thin. It is probably worth the minor overhead of having more unused interceptors to allow more sharing of stacks. Always more tech debt to work on! -Jasper From: Christoph Nenning <christoph.nenn...@lex-com.net> To: Struts Users Mailing List <user@struts.apache.org> Sent: Tuesday, October 13, 2015 8:13 AM Subject: Re: How to add a global interceptor > From: Jasper Rosenberg <jasper_rosenb...@yahoo.com.INVALID> > To: Struts Users Mailing List <user@struts.apache.org>, > Date: 13.10.2015 14:01 > Subject: Re: How to add a global interceptor > > Thanks for the feedback! > To be clear, we do have a number of interceptor stacks that are > shared and we follow a similar pattern to what you describe where we > add additional interceptors where needed before or after a common > stack. There are places that we might be able to reduce even that > pattern by switching to action mapping parameters, I will definitely > revisit that. > The real problem is simply that there are so many actions at this > point that to make sure we didn't miss any outlier custom stacks, we > would have to review each one. We would then have to add a struts > configuration validation step to make sure no one introduced a new > stack missing the required one (which I suppose wouldn't be that big > a deal since we already do other configuration checks in development > mode in a DispatcherListener). Definitely food for thought... > Thanks,Jasper
Well, keeping so many stacks around surely is maintenance hell. And changing these stacks additonally in code does not make it better ;) But as I said before: In your case I don't have a better idea. Regards, Christoph > From: Christoph Nenning <christoph.nenn...@lex-com.net> > To: Struts Users Mailing List <user@struts.apache.org> > Sent: Tuesday, October 13, 2015 7:35 AM > Subject: Re: How to add a global interceptor > > > From: Jasper Rosenberg <jasper_rosenb...@yahoo.com.INVALID> > > To: "user@struts.apache.org" <user@struts.apache.org>, > > Date: 13.10.2015 13:26 > > Subject: How to add a global interceptor > > > > Hi, > > > > > > > > I work on a project with hundreds of struts actions manywith their > > own custom interceptor stacks specified. > > > > Having actions with own interceptor stacks is quite special. Usually > people have hundreds of actions but just a few interceptor stacks. And the > few stacks are not created by copy-paste but by overriding configuration > parameters and adding interceptors at the beginning or end of the stack. > > > > > > > > > > We have recently internationalized the site, and so I had aneed to > > add an i18n interceptor to the top of every action stack. It would > > have been impractical (and difficultto enforce for future actions) > > to add the new interceptor to every actiondefinition. > > > > > > > > My solution was to override the ActionProxyFactory to returnour own > > ActionInvocation, which in turn always prepends the i18n interceptor > > tothe interceptor stack during initialization. > > > > In your case that sounds alright. > > > What are the reasons that you need so many different interceptor stacks? > > > Regards, > Christoph > > This Email was scanned by Sophos Anti Virus > > > This Email was scanned by Sophos Anti Virus