You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian McCullough <bd...@buadh-brath.com> on 2011/12/09 20:48:26 UTC

Interceptor question

Folks,

I don't seem to be able to ask this question in a way that lets the search engines give me a useful answer, so I am coming here.


I am working on adding functionality to an application that I inherited.

I have struts.xml as well as several struts-packageName.xml files in WEB-INF/classes.

In struts.xml I have several "custom" interceptors defined, as well as interceptor stacks that use those, as well as the "built-in" interceptors.  One of those stacks is defined as default with default-interceptor-ref.

The struts-packageName.xml files are each included with Include File statements at the top of struts.xml.

Each of them has the following at the top:

<package name="packageName" extends="default" namespace="/packageName">


They also have various Action definitions, specific to the particular packageName.


My question has to do with the Interceptors and Interceptor Stacks defined in struts.xml.  Incidentally, all of those definitions are after the Include File statements for all of the struts-packageName.xml files.


I would like to be able to define a particular Interceptor Stack as being the Default for a particular packageName, and applicable to the whole Package and its Actions, instead of having to code interceptor-def for each Action.

Is this possible?


Thanks,
Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Interceptor question

Posted by Brian McCullough <bd...@buadh-brath.com>.
On Fri, Dec 09, 2011 at 03:37:10PM -0500, Dave Newton wrote:
> That was a long question :(

Yes, I wanted to make sure that I had covered all of what I had already done.


> Yes; the default-intereptor-ref element is a per-package configuration, as
> described in the pacakge configuration docs [1].

Unfortunately, when I had tried that before, it didn't seem to work.  I guess that there is something else wrong.

One thing that I have been experimenting with since then, is the position in the stack of this particular interceptor, which is dealing with authentication.


I will work on it.


Thanks,
Brian


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Interceptor question

Posted by Dave Newton <da...@gmail.com>.
That was a long question :(

On Fri, Dec 9, 2011 at 2:48 PM, Brian McCullough <bd...@buadh-brath.com>wrote:

> I would like to be able to define a particular Interceptor Stack as being
> the Default for a particular packageName, and applicable to the whole
> Package and its Actions, instead of having to code interceptor-def for each
> Action.
>
> Is this possible?
>

Yes; the default-intereptor-ref element is a per-package configuration, as
described in the pacakge configuration docs [1].

Dave

[1] http://struts.apache.org/2.x/docs/package-configuration.html