2
嗨 我们已经创建了一个名为appInterceptorStack定制拦截器堆栈,并提到它作为一个<default-interceptor-ref name="appInterceptorStack"/>
,跳过默认拦截器堆栈上的特定类
appInterceptorStack - >不重视他们的验证和工作流程拦截。
但现在的具体操作类,我需要使用validate方法,所以我需要验证拦截
我创建了验证和工作流程拦截器新型拦截堆栈,以及从动作类称为它。但是只有默认的拦截器堆栈正在执行。改变后的一个没有被调用,请在下面找到示例代码。
<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>
有人能帮我吗?
供参考:您的代码中的几个引号是在Microsoft Word中键入内容时得到的“漂亮”引号。我不确定这是否仅限于您的示例,或者是否存在于您的真实代码中。 – 2011-06-06 15:10:33