title: Spring MVC ajax POST request fails when sending large string
body: <p>I am working on web-app which includes some sort of web based XML editor. Basically I use html textarea as my "editor" and when user clicks "save" button, AJAX post request containing modified XML is sent to server. I use $.ajax function</p>
  
  <pre><code> function saveXML(){
       var cm = editor.mirror; 
       var textXML = cm.getValue(); // textXML is a String representing edited XML
       $.ajax({
              url: "saveEditedBatch",
              data: {xmlString: textXML}, 
              type: 'POST',
              success : function(response){
  
              },
              error : function (){  
                  alert("error");
              } 
          });  
  </code></pre>
  
  <p>on server side I have controller</p>
  
  <pre><code>    @RequestMapping(value = "/saveEditedBatch", method = RequestMethod.POST)
  public @ResponseBody JsonResponse saveEditedBatch(@RequestParam(value = "xmlString") String xmlString){
      JsonResponse response = new JsonResponse();
      byte[] byteXML = xmlString.getBytes();
      byteXML =  xmlAccess(new ByteArrayInputStream(byteXML));
  
      // do something with byteXML
  
      return response;
  }
  </code></pre>
  
  <p>When my XML and hence the String that I send to server is small - everything works fine. However when XML is large - I get "HTTP Status 400 - Required String parameter 'xmlString' is not present" even though I know I am passing it. What can I do?</p>