title: pass javascript response variable to spring controller function
body: <p>The following javascript code works with the facebook login window appearing and allowing a user to login. The response values are captured and I know it works as alerts appear where setup but I cannot pass the value back to a controller method.</p>
  
  <pre><code> @RequestMapping(value ="/getAccessToken" , method = RequestMethod.POST)
   public @ResponseBody String getAccessToken(@RequestBody String token){
  
       System.out.println(token);
  
       return token;
    } 
  </code></pre>
  
  <p>Javascript method called:</p>
  
  <pre><code>    function doLogin() {
          FB.login(function(response) {
          alert(response);
          console.log(response);
          if (response.authResponse) {
                      alert(response.authResponse.userID);
                      alert(response.authResponse.accessToken);
                      var Token = response.authResponse.accessToken;
                      alert(Token);
                      $.ajax({
                          type: "POST",
                          url: "/HelloController/getAccessToken",
                          data: Token,
                          success: function (result) {
                                alert("Token");
                          },
                          error: function (result) {
                                alert("oops");
                          }
                      });
                       document.getElementById('loginBtn').style.
           display = 'none';
           getUserData();
          }}, {perms:'manage_pages', 
         scope: 'email,public_profile', return_scopes: true});
       };
  </code></pre>
  
  <p>The error I get is the following:</p>
  
  <pre><code>WARN 25660 --- [nio-8080-exec-9] 
  o.s.web.servlet.PageNotFound             : 
  Request method 'POST' not supported
  </code></pre>
  
  <p>Appreciate responses.</p>