title: spring security 3.1. custom authentication-failure-url with url parameters
body: <p>I googled and tried lot of variants for some hours but without any success.
  Please help me to find a solution.</p>
  
  <p>Spring version: Spring 3.1</p>
  
  <p>I have login page. Login page depends on URL parameter:</p>
  
  <pre><code>/login?code=client1
  </code></pre>
  
  <p>or</p>
  
  <pre><code>/login?code=client2
  </code></pre>
  
  <p>So client1 and client2 has different login pages.</p>
  
  <p>security.xml:</p>
  
  <pre><code>&lt;sec:form-login login-page="/login" default-target-url="/start" authentication-failure-url="/login"/&gt;
  </code></pre>
  
  <p>So if user make wrong authentication I show him /login page...
  But point is I have to show login page with corresponding code parameter.</p>
  
  <p>What should I do? Have tyou examples please?</p>
  
  <p>Thanks a lot for advance.</p>
  
  <p><b>UPDATE #1:</b></p>
  
  <p>I created FailureHandler class:</p>
  
  <pre><code>public class GRSAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler implements AuthenticationFailureHandler {
  
  @Override
  public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) {
  
  }
  
  }
  </code></pre>
  
  <p>What should I write inside to get redirect to needed URL?
  Please if you can give me more details.</p>
  
  <p>Thanks a lot!</p>