请教springMvc的controller如何处理json对象数组
项目中遇到个批处理,需要前台传递一个json格式对象数组,如下:
var data={
"wos":[{"id":1,"satisfaction":10,"satisfactionRemark":""},
{"id":2,"satisfaction":20,"satisfactionRemark":""},
{"id":3,"satisfaction":30,"satisfactionRemark":""}]
};
我用的是jQuery.ajax的post将数据扔给controller接收,但是试了各种接收方式均无效,请大神们帮帮忙看看
------解决方案--------------------
Java code
$.ajax(
{
url:url,
type: "POST",
data: JSON.stringify(x),
success: function(data){
},
dataType: "json",
contentType: "application/json"
} );