You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Darren James <jd...@netflix.com> on 2008/01/15 23:52:54 UTC

question about interceptors

Hi all,

I'm new to struts2 and have some questions about configuring Interceptors.

If your action does not define an interceptor does it get the default 
one (i.e. "defaultStack")?

e.g.
        <action name="MyAction" class="....">   // does this action get 
the struts2 default interceptor stack
            <result>/myAction.jsjp</result>
        </action>

also, if your action *does* define an interceptor, does that augment the 
default one or override it?

e.g.
        <action name="MyAction" class="...">
            <interceptor-ref name="myinterceptor"/>  // do i get 
defaultStack, or did i just override it?
            <result>/myAction.jsp</result>
        </action>


thanks,

- darren.


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


Re: question about interceptors

Posted by Dave Newton <ne...@yahoo.com>.
--- Darren James <jd...@netflix.com> wrote:
> If your action does not define an interceptor does it get the default 
> one (i.e. "defaultStack")?

Yep.

> also, if your action *does* define an interceptor, does that augment the 
> default one or override it?

Override.

>         <action name="MyAction" class="...">
>             <interceptor-ref name="myinterceptor"/>  // do i get 
> defaultStack, or did i just override it?
>             <result>/myAction.jsp</result>
>         </action>

You need to include another <interceptor-ref.../> element if you want the
default stack in addition to the "myinterceptor" interceptor. (Or define an
interceptor stack with your interceptor in it, etc.)

d.


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