ajax:
$.ajax({
type: 'POST',
url:rootPath+"/deviceInfo/saveElements.do",
dataType: 'json',
contentType: "application/json",
data:JSON.stringify(elements),
success:function(){
}
});
java:
public Result<Boolean> saveElements(@RequestBody List<ElementInfo> elements){
注意点:
data名字不能给名称,给了会报错
错误范例:
$.ajax({
type: 'POST',
url:rootPath+"/deviceInfo/saveElements.do",
dataType: 'json',
contentType: "application/json",
data:{“elements”:JSON.stringify(elements)},
success:function(){
}
});