Struts 2: excluding method from validation from just the defaultStack interceptor

前端 未结 1 1488
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 17:29

I want to be able to disable form validation for one action in Struts 2, but have the rest of the interceptor stack still be able to run.

I have an interceptor that

相关标签:
1条回答
  • 2021-01-13 17:56

    I figured it out--the solution looks like this:

    <action name="Deposit!*" method="{1}" class="csc309.a4.banking.Deposit">
        <result name="success">/banking/Deposit.jsp</result>
        <interceptor-ref name="secureBanking">
            <param name="workflow.excludeMethods">choose</param>
        </interceptor-ref>
    </action>
    

    Interceptor parameters can be restricted to specific interceptors by prepending the interceptor name to the parameter name. In this case, only the workflow interceptor will exclude the choose method; other interceptors will still fire for the choose action method.

    0 讨论(0)
提交回复
热议问题