Hi Matt,

Thanks for the reply. Its been a while since I posted this message. Yep, the
struts.xml is/was correct. I never did come right with the "default"
interceptor stack, I ended up with the following solution which does work
(feel free to comment as I am no struts 2 guru):

in struts.xml I added:

    <package name="dev" extends="default" namespace="/developer">
        <interceptors>
            <interceptor name="authz" class="authzInterceptor"/>
            
            <!-- Copied from struts-default.xml and changed validation
exclude methods -->
            <interceptor-stack name="myStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>                
                <interceptor-ref name="params"/> <!-- params injection for
prepare -->
                <interceptor-ref name="servlet-config"/>                        
        
                <interceptor-ref name="authz"/>                
                <interceptor-ref name="prepare"/>                    
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <!--  <interceptor-ref name="debugging"/>  -->                
                <interceptor-ref name="scoped-model-driven"/>
                <interceptor-ref name="model-driven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="static-params"/>
                <interceptor-ref name="params">
                        dojo\..*
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    cancel,execute,delete,edit,list,start
                </interceptor-ref>                 
                <interceptor-ref name="workflow">
                    input,back,cancel
                </interceptor-ref>
            </interceptor-stack>                        
        </interceptors>
        
        <default-interceptor-ref name="myStack"/>    
    </package>


The action is annotated as follows:

@ParentPackage(value="dev")     // See struts.xml
@Namespace("/developer")
@Results({
    @Result(name=ABCAction .INPUT,  value="a.jsp"),
    @Result(name=ABCAction .SUCCESS,value="b.jsp"),    
    @Result(name=ABCAction .LIST,value="c.jsp")
})
public class ABCAction 
    extends BaseAction
    implements Preparable, AuthzAware
{
 ....
    @SkipValidation
    public String execOther() {       
       ....
    }
 ....
}


An aside, I have more recently discovered that when one uses @SkipValidation
on a specific method,
then the struts.xml config is ignored for "validation skipping" and one ends
up in annotating all the action methods, as opposed to just the exceptions
(e.g. execOther above) as I had hoped for.

I am curious to know your response.

Cheers
    Caleb.




Are you sure you're editing the correct struts.xml? What you have should
work.

Matt

On 1/22/08, J&M <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am using appfuse 2.0.1. I am trying to customise the interceptor stack
> in
> the struts.xml file. I don't seem to be getting anything out of my
> changes.
> Below is the interceptor stack I have modifed. Does it look reasonable?
> How
> can I get log of the interceptor stack activity? Or in what way can I
> debug
> the call stack to see which filters are being called, etc? To me it looks
> like this stack defintion is being ignored completely. Any suggestions?
>
>
>
>     <!-- Configuration for the default package. -->
>     <package name="default" extends="struts-default">
>
>         <interceptors>
>             <!-- Interceptor to handle allowing only admins to certain
> actions -->
>             <interceptor name="adminOnly" class="adminInterceptor"/>
>             <interceptor name="authz" class="authzInterceptor"/>
>
>             <!-- Copied from struts-default.xml and changed validation
> exclude methods -->
>             <interceptor-stack name="defaultStack">
>                 <interceptor-ref name="exception"/>
>                 <interceptor-ref name="alias"/>
>                 <interceptor-ref name="servlet-config"/>
>                 <interceptor-ref name="params"/> <!-- added: params
> injection for prepare -->
>                 <interceptor-ref name="authz"/>   <!-- added: own
> interceptor impl -->
>                 <interceptor-ref name="prepare"/>
>                 <interceptor-ref name="i18n"/>
>                 <interceptor-ref name="chain"/>
>                 <interceptor-ref name="debugging"/>
>                 <interceptor-ref name="profiling"/>
>                 <interceptor-ref name="scoped-model-driven"/>
>                 <interceptor-ref name="model-driven"/>
>                 <interceptor-ref name="fileUpload"/>
>                 <interceptor-ref name="checkbox"/>
>                 <interceptor-ref name="static-params"/>
>                 <interceptor-ref name="params">
>                         dojo\..*
>                 </interceptor-ref>
>                 <interceptor-ref name="conversionError"/>
>                 <interceptor-ref name="validation">
>                     cancel,execute,delete,edit,list,start
>                 </interceptor-ref>
>                 <interceptor-ref name="workflow">
>                     input,back,cancel,browse
>                 </interceptor-ref>
>             </interceptor-stack>
>             <interceptor-stack name="fileUploadStack">
>                 <interceptor-ref name="fileUpload"/>
>                 <interceptor-ref name="defaultStack"/>
>             </interceptor-stack>
>             <interceptor-stack name="adminCheck">
>                 <interceptor-ref name="defaultStack"/>
>                 <interceptor-ref name="adminOnly"/>
>             </interceptor-stack>
>         </interceptors>

-- 
View this message in context: 
http://www.nabble.com/Interceptor-stack-help-tp15031208s2369p15343381.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to