I want to be able to disable form validation for a single action in Struts 2, but the rest of the interceptor stack may still work.
I have an interceptor that checks if a user is logged in, which I always want to perform, but for some actions (for example, entering information) I do not want the validate action to be called.
I tried to do something like the following:
<interceptors> <interceptor name="bankingAuthenticator" class="csc309.a4.banking.BankUserAuthenticator"/> <interceptor-stack name="secureBanking"> <interceptor-ref name="bankingAuthenticator"/> <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors> <default-interceptor-ref name="secureBanking"/> <action name="Deposit!*" method="{1}" class="csc309.a4.banking.Deposit"> <result name="success">/banking/Deposit.jsp</result> <interceptor-ref name="defaultStack"> <param name="workflow.excludeMethods">choose</param> </interceptor-ref> </action>
But it misses both the bankingAuthenticator interceptor and the check.
source share