views:

36

answers:

1

I write in my struts.xml this interceptor stack

<interceptor-stack name="project-interceptors-stack">                                               
    <interceptor-ref name="my1-i" />
    <interceptor-ref name="my2-i" />                
    <interceptor-ref name="paramsPrepareParamsStack" /> 
    <interceptor-ref name="logger" />
    <interceptor-ref name="timer" />
</interceptor-stack>

where my1-i and my2-i are my custom interceptor. I do not use this interceptor

<interceptor-ref name="i18n"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="modelDriven"/>
<interceptor-ref name="validation">

but, my action's, which are Preparable, ModelDriven and Validateable work well ... why ?

Follow-up: I omitted an important detail: the interceptor stack is defined in the first package and is inherited by all sub package.

More precisely i wanted to ask this: why if my action implements Preparable, and i don't have the interceptor '<interceptor-ref name="prepare"/>' in my custom stack, the prepare method is called correctly?

+1  A: 

What do you precisely mean with this?

my actions, which are Preparable, ModelDriven and Validateable work well

You mean that the interceptors appear to be applied, for example, declarative validation is applied? (You can check what each standard interceptor is supposed to do here )

If so, you should check that your stack is effectively used in you action, by specifying it in the action mapping or globally (the code you posted simply defines a stack).

leonbloy