title: Spring Security 3 Get Initially Requested URL
body: <p>I need to modify my spring security login page based on where the user came from. My client wants the styles different between the two.  If you come from <code>appcontextroot/test</code> vs <code>appcontextroot/choose</code>. I tried to do the below but the <code>String url=savedRequest.getRedirectUrl();</code> is equal to the spring login page already and not the initial page requested by the user. Any ideas?</p>
  
  <pre><code>ExternalContext externalContext = FacesUtils.getExternalContext();
      HttpServletRequest request = (HttpServletRequest)externalContext.getRequest();
      HttpSession session = request.getSession(false);
      if(session != null) {
          SavedRequest savedRequest = new DefaultSavedRequest(request, new PortResolverImpl());
          String url=savedRequest.getRedirectUrl();
      } 
  </code></pre>