How to exclude One action from default interceptor in Struts 2

1.6k views Asked by At

I want to exclude login action from my default interceptor without putting it a diffrent package

<default-interceptor-ref name="loginStack"></default-interceptor-ref>

the action that i want to exclude is Login Action

<action name="loginUser" class="com.action.LoginAction" method="login">
1

There are 1 answers

0
Andrea Ligios On BEST ANSWER

You don't exclude actions from interceptors, you exclude interceptors from actions.

Specifically, if you want to use the defaultStack for your login action and the loginStack for all the other actions, you do:

<default-interceptor-ref name="loginStack"></default-interceptor-ref>

...

<action name="loginUser" class="com.action.LoginAction" method="login">
    <interceptor-ref name="defaultStack" />
    <result>login.jsp</result>
</action>