title: Spring MVC - redirect with jQuery
body: <p>I am making an AJAX call to a controller, and I want to redirect to a new page on Success. So I have have the redirection logic within my success callback function. But it doesn't redirect to a new page instead it stays on the same page. </p>
  
  <p><code>The intriguing thing is that a GET Request (with the form Data I just sent via POST) is made after the Ajax Callback is executed. that is, I see a GET Request in the Address Bar.</code></p>
  
  <p>Here is my AJAX request</p>
  
  <pre><code>$.ajax({
          url: "processData",
          type: "POST",
          dataType: 'json',
          contentType:'application/json',
          async: false,
          data: JSON.stringify(req),
          success: function(result) {
              url = window.location.href;
              url = url.replace("processData", "getMoreData");
              alert(url); // correct url is printed
              window.location.replace(url);
          },
          error: function() {
              alert("--- Failure ---");
          }
      });
  </code></pre>
  
  <p>What's wrong in here?</p>