title: Spring security 3.0: SavedRequest always null
body: <p>In my application I'm using Spring Security 3.0 and in the class used to intercept the "post-authentication" I have something like:</p>
  
  <pre><code>public class CustomAuthenticationHandler extends SavedRequestAwareAuthenticationSuccessHandler {
  
     public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
  
      SavedRequest savedRequest = new HttpSessionRequestCache().getRequest(request, response);
  ...
     }
  }
  &lt;security:http&gt;
      &lt;security:form-login login-page="/login/" always-use-default-target="false"  authentication-success-handler-ref="customAuthenticationHandler" authentication-failure-url="/login/?login_error=1"/&gt;
   ...
  &lt;/security:http&gt;
  
  &lt;bean id="customAuthenticationHandler" class="org.myproject.CustomAuthenticationHandler"/&gt;
  </code></pre>
  
  <p>When I log in from a generic page "X" inside the application I expect to be redirect after successful authentication to "X" but I always land to the home page.
  The 'savedRequest' variable above returns always null. Is there any specific setting missing? How can I get the correct redirection?</p>