I try to return data from controller to AJAX success() callback. This code perfectly works for 100,000 objects. But when I increase size of list to 1 million objects, it goes to success() callback, but returning null as response. Could you help me with finding the way to return 1 mln of objects?
A.$.ajax({
url: 'getData',
dataType: 'json',
success: function (response) {
alert(response)
}
@RequestMapping("/getData")
public @ResponseBody
void download(HttpServletResponse response ) throws IOException, JSONException
{
List <Objects> list = getListFromService();
response.setContentType("application/json");
PrintWriter out = response.getWriter();
ObjectMapper mapper = new ObjectMapper();
String jsonString = mapper.writeValueAsString(list);
out.print(jsonString);
out.flush();
}