title: How to send and receive ajax request with parameter in Spring Framework?
body: <p>I'm try to send a request with ajax but have status 400 bad request.
  what kind of data should i send and how to get data in controller?
  I'm sure that request is fine only the parameter go wrong</p>
  
  <p>jsp</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      var SubmitRequest = function(){
          $.ajax({
                  url : "submit.htm",
                  data: document.getElementById('inputUrl'),
                  type: "POST",
                  dataType: "text",
                  contentType: false, 
                  processData: false,
                  success : 
                      function(response) {
                          $('#response').html(response);
                      }
          });
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>controller</p>
  
  <pre><code>@RequestMapping(value = "/submit", method = RequestMethod.POST)
  public @ResponseBody
  String Submit(@RequestParam String request) {
      APIConnection connect = new APIConnection();
      String resp = "";
      try {
          resp = "&lt;textarea  rows='10'cols='100'&gt;" + connect.doConnection(request) + "&lt;/textarea&gt;";
      } catch (Exception e) {
          // TODO Auto-generated catch block
          resp = "&lt;textarea  rows='10'cols='100'&gt;" + "Request failed, please try again." + "&lt;/textarea&gt;";
      }
      return resp;
  }
  </code></pre>