title: Http POST Method and Spring MVC RedirectView
body: <p>Using Spring Social and Spring MVC, I tried to use the RedirectView when connecting to social provider and must be missing something and does not manage to get a successfull connection process to LinkedIn.</p>
  
  <p>Here are the 2 controller methods : the first one acts as expected : based on a service provider choice from the user, it detects that it is not connected to Linked in thru the <code>sp.isconnected()</code> call and when not redirect to a view that is controlled by the 2nd method to initiate the linked in connection.</p>
  
  <p>The second method setsup the appropriate right parameters and redirect to appropriate spring social connection URL (URIs.SPRINGLISIGNIN = "/connect/linkedin")but the Spring Social ConnectController would expect a POST method at this stage and I do not manage to figure out how to pass it thru the RedirectView. I was expecting the initial POST method from the first controller method would be carried out to the second one but it is not the case. In debug mode in the lisgnin method, request.getMethod() shows a GET value.</p>
  
  <pre><code>   @RequestMapping(value = Uris.SPCHOICE, method = RequestMethod.POST)
  public RedirectView Spchoice (@RequestParam("sp") String sp, Model model) {
  
      ServiceProviders spasenum = ServiceProviders.valueOf(sp);
      RedirectView toReturn;
      SPConnectionRetriever spResolver=null;
      switch (spasenum) {
      case FACEBOOK :
          spResolver = FBConnectionRetriever;   
          break;
      case LINKEDIN :
          spResolver = LIConnectionRetriever;     
          break;
      }
      SecurityContext.setCurrentSpResolver(spResolver);
      if (spResolver.isconnected())
          toReturn  = new RedirectView(Uris.MAIN, true);
      else
          toReturn = new RedirectView(spResolver.getConnectUrl(), true);
  
      return toReturn;
  }
  </code></pre>
  
  <p>Here is the 2nd method :</p>
  
  <pre><code>@RequestMapping(value = Uris.SIGNINLI)
  public RedirectView liSignin(HttpServletRequest request, HttpServletResponse response) {
      request.setAttribute("scope", "r_fullprofile,r_network");
      return new RedirectView(Uris.SPRINGLISIGNIN, true);
  </code></pre>