Hi All,
I am passing json data to servlet as below:
and trying to get that value in servlet but it does not seem to be working. I can see the data in firebug under POST tab and Content-Type is "applicatio n/json; charset=UTF-8".
The data that I can see on POST tab is as below:
In servlet I tried to get the value using
and
but everything is coming as null.
Please advice what I am doing wrong.
Thanks,
Gaurav
I am passing json data to servlet as below:
Code:
Ext.Ajax.request({
url: CONTEXTPATH + "/ServletURL",
type: 'post',
jsonData :{
record: sample,
comments: text
}
});
The data that I can see on POST tab is as below:
Code:
{"record":{"key1":"value1","key2":"value2","key3":"value3","key4":"value4","key5":"value5"},"comments":"Testing"}
Code:
request.getParameter("record")
Code:
request.getParameter("comments")
Please advice what I am doing wrong.
Thanks,
Gaurav
Comment