title: struts2 interceptor redirecting twice to action
body: <p>i have a logininterceptor that checks session member object and if it is null redirect it to login page,else continue to action .</p>
  
  <p>Every action blocks has this interceptor. The problem is When you call action it hits the interceptor, if it is true continue to action method, then return "success" or "input" then again hits the interceptor to redirect that selected result name. </p>
  
  <p>How can i prevent to call interceptor twice?</p>
  
  <p>Interceptor code :</p>
  
  <pre><code>public String intercept(ActionInvocation actionInvocation) throws Exception {
          HttpServletRequest request = (HttpServletRequest) actionInvocation.getInvocationContext().get(StrutsStatics.HTTP_REQUEST);
          HttpSession session = request.getSession();
  
      if (session.getAttribute("member")==null) {
  
          return Action.LOGIN;
      } else {
          return actionInvocation.invoke();
      }
  }
  </code></pre>
  
  <p>struts.xml action view :</p>
  
  <pre><code>    &lt;action name="actionName" class="actionClass" method="init"&gt;
          &lt;interceptor-ref name="loginStack"/&gt;
          &lt;result name="input"&gt;show.jsp&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>