I'm making a web application that send large amount of data in report processing in spring mvc framework with tomcat server. What i encounter is that when the transaction is about 300 rows, it's not sending at all.Here is my controller:
@RequestMapping(value = "/save",method=RequestMethod.POST)
public @ResponseBody String saveForm(AbtractForm form,
HttpServletRequest request, BindingResult result){
String returnText="";
if(!result.hasErrors()){
try{
servicesInterface.saveFormImpl(form);
returnText = "ENTRY HAS BEEN SAVED";
}catch(Exception ex){
ex.printStackTrace();
System.out.println("Info log:"+ex.getMessage());
returnText = "INVALID ENTRY.CHECK LOG FOR MORE INFORMATION.";
}
}else{
returnText = "INVALID ENTRY.CHECK LOG FOR MORE INFORMATION.";
}
return returnText;
}
This is the configuration of tomcat server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" maxPostSize="-1" />
This is my ajax function to send data:
$.ajax({
type: 'POST',
dataType:'JSON',
url: '/save',
data:$("#formID").serialize(),
async:false,
success:function(response){
if(response == "ENTRY HAS BEEN SAVED"){
$('#dataTable tbody tr').text("");
$("#done").attr("class","success");
}else{
$("#done").attr("class","error");
}
$("#load").hide();
$("#spanMessage").text(response);
},
error:function(er,st,th){
$("#spanMessage").text("ERROR FOUND");
$("#load").hide();
},
});
Tomact server configuration for maxPostSize is already set to -1(unlimited post max size)but its not working.When i send data less 200 rows, it works perfectly. I have an array element for the transaction (table rows). This is the error i found:
Request Method:POST
Status Code:404 Not Found
The request headers:
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:149602
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie:JSESSIONID=F6CF1C8FBC8144F94F50F0BC329E3C70
The response headers:
Cache-Control:no-cache
Cache-Control:no-store
Content-Language:en-US
Pragma:no-cache
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
My controller is not throwing me an error in log.But when i send data in small amount, the controller is responding with successfully save. Is there another way to configure the limit size of tomcat server?
thanks.