Ok - I'm having a bad start to the day and this is driving me nuts. I'm using the Convention plugin, and below I've attached a copy of my struts.xml. As you can see I've got two custom interceptors which I'm adding to a copy of the param-prepare-param stack.
Through logging I can see that my two custome interceptors are being initialized (their constructors are being called) but thereafter neither of the interceptors intercept() method is being invoked.
Using the config-browser plugin I see that my custom interceptors are *not* in the stack for the default, admin or diagnostic namespaces. Further none of the namespaces are using the param-prepare-param stack the first Parameter interceptor is missing as well. It looks like I'm using the bog-standard struts-default stack.
Are you setting the parent package constant or otherwise telling the Convention plugin what package to use (or interceptors) in your "conventional" and/or annotated actions?
Joined: Jan 21, 2010
David Newton wrote:Are you setting the parent package constant or otherwise telling the Convention plugin what package to use (or interceptors) in your "conventional" and/or annotated actions?
No, I wasn't - I've added the @ParentPackage annotation to my actions and now, most of them are picking up the correct stack. The ones that aren't picking up the correct stack are those that are using JSON results. For those to work you have to specify @ParentPackage(value="json-default") which extends struts-default, so those actions are not using the correct interceptor stack. I'll try adding the @Interceptor annotation to those, but it all seems to be getting a bit kludgy.