tags:

views:

12

answers:

2

I need to inherit paramsPrepareParamsStack inceptor stack into mystack and need to override vilidation interceptor parameters. How do i do it?

A: 

Simply copy the entire stack into your struts.xml and override the parameters as needed:

       <interceptor-stack name="paramsPrepareParamsStack">
            <interceptor-ref name="exception"/>
            <interceptor-ref name="alias"/>
            <interceptor-ref name="params"/>
            <interceptor-ref name="servletConfig"/>
            <interceptor-ref name="prepare"/>
            <interceptor-ref name="i18n"/>
            <interceptor-ref name="chain"/>
            <interceptor-ref name="modelDriven"/>
            <interceptor-ref name="fileUpload"/>
            <interceptor-ref name="checkbox"/>
            <interceptor-ref name="staticParams"/>
            <interceptor-ref name="params"/>
            <interceptor-ref name="conversionError"/>
            <interceptor-ref name="validation">
                <param name="excludeMethods">your,methods,skip,validation</param>
            </interceptor-ref>
            <interceptor-ref name="workflow">
                <param name="excludeMethods">your,methods,skip,validation</param>
            </interceptor-ref>
        </interceptor-stack>
Pat
What will happen if i specify as <interceptors> <interceptor-stack name="ehspre2stack"> <interceptor-ref name="paramsPrepareParamsStack"> <param name="validation.excludeMethods"> list,loadedit,remove,execute,reset </param> </interceptor-ref> </interceptor-stack> </interceptors>
Jothi
I don't think it'll work, but feel free to give it a try.
Pat
A: 

the below code executes well..

<interceptors>
            <interceptor-stack name="ehspre2stack">
                <interceptor-ref name="paramsPrepareParamsStack">
                    <param name="validation.excludeMethods">
                        list,loadedit,remove,execute,reset,loadAdd
                    </param>
                    <param name="exception.logEnabled">true</param>
                    <param name="exception.logLevel">ERROR</param>
                </interceptor-ref>
            </interceptor-stack>
        </interceptors>
Jothi