嗨,我们创建了一个名为 appInterceptorStack 的自定义拦截器堆栈,并将其称为<default-interceptor-ref name="appInterceptorStack"/>
,
appInterceptorStack -> 没有附加验证和工作流拦截器。
但是现在对于一个特定的动作类,我需要使用验证方法,所以我需要验证拦截器
我创建了一个带有验证和工作流拦截器的新拦截器堆栈,并从动作类中引用它。但是只有默认的拦截器堆栈被执行。更改的没有被调用,请在下面找到示例代码。
<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>
有人可以帮帮我吗?