I am attempting to send a large AJAX request of type POST through Spring MVC. The request contains data representing IDs of rows that are selected in a grid. The request looks something like this, where N is about 30,000:
POST /foo/view? HTTP/1.1
Host: localhost:8443
Connection: keep-alive
Content-Length: 618953
Accept: text/html, */*; q=0.01
Origin: https://localhost:8443
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://localhost:8443/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
And the form data contains encoded selections
:
selection=1
selection=2
selection=...
selection=n
The controller method that is mapped to handle this request is annotated as follows:
@RequestMapping(method = RequestMethod.POST, value = "/foo/view")
public void controllerMethod(User user, @ModelAttribute CustomModelMap inModel, BindingResult result) {
...
}
Where CustomModelMap simply contains accessors/mutators to map the selections to a collection.
The problem I am running into is that as soon as I hit the controller, the ModelMap is populated with only 9,997 selections (it's always this number when the request contains over 9,997 selections). I triple checked the AJAX request I am sending to ensure that there are indeed 30,000 selections.
I thought maybe that my webserver didn't like the large amount of data in the request headers, but the request totals about 600k, whereas Tomcat seems to allow up to 2mb by default for POSTs.
Any ideas on what else I can check?