Finally i solved the issue.I am sharing here which might be useful for any one else.
In place of sending data using ajax Here i am sending data appending in query string of url.Here is sample.
$.ajax({
url: url+"?data="+JSON.stringify(requests),
contentType: "application/json; charset=utf-8",
type: 'POST',
success: function(data){
//success code
},
error: function(xhr, status, error) {
alert(xhr.responseText);
alert('there is some problem in updating data');
}
});
This is the code of action
public String testUrl()
{
String data = request.getParameter("data");
System.out.println("data is :"+data);
List<TestPojo> testPojos=new ArrayList<TestPojo>();
try{
JSONArray jsonArray1 = new JSONArray(data);
for (int i = 0; i < jsonArray1.length(); i++) {
JSONObject jsonObject = jsonArray1.getJSONObject(i);
TestPojo testPojo = new TestPojo();
testPojo.setTestField(jsonObject.get("testField").toString());
testPojos.add(testPojo);
}
//additional code here
}catch (Exception e) {
System.out.println("error");
}
return SUCCESS;
}