Skipping default interceptor stack only on specific class
Hi
We have created a customized interceptor stack called appInterceptorStack and referred it as a <default-interceptor-ref name="appInterceptorStack"/>
,
appInterceptorStack -> dont have validation and workflow interceptors attached to them.
But now for a specific action clas开发者_运维百科s I need to use validate method so I need validation interceptor
I created a new Interceptor stack with validation and workflow interceptors and referred it from action class. But only the default interceptor stack is getting executed. The changed one is not getting called, Please find the sample code below.
<package name="default" extends="struts-default">
<interceptor-stack name=”AppStack”>
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="params"/>
</interceptor-stack>
<interceptor-stack name=”GuiStack”>
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="params"/>
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />
</interceptor-stack>
<default-interceptor-ref name="AppStack"/>
<action name="test" class="com.jranch.Test">
<interceptor-ref name="GuiStack”/>
<result name="input">login.jsp</result>
<result name="success" type="redirect-action">/secure/home</result>
</action>
</package>
Can someone please help me?
The configuration looks correct. Can you turn on debug logging for com.opensymphony.
You can then see the interceptors being called in turn. This is the quickest way of seeing what is being called.
精彩评论