How to inherit interceptor stack and override one of the intercetor in that?
I need to inherit paramsPrepareParamsStack
interceptor stack into m开发者_运维知识库ystack
and need to override validation interceptor parameters. How do I do it?
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>
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>
精彩评论