lzbcrs
2014-05-19 16:13jquery ajax前台通过json格式往后台传数据 后台对象接到的老是null
前台的 静态json数据
var resContactInfos1 = [{
metadataId: '001',
orgCode:'001',
orgName: 'zhangsan',
address: '20',
email: 'shanghai'
},
{
metadataId: '002',
orgCode: '002',
orgName: 'beijing',
address: '21',
email: 'beijing'
}
];
ajax 请求
var data1={resContactInfo:resContactInfos1};
$.ajax({
url: "rc/resourceCatalogManagerAction!saveResource.action", //后台处理的地址
type: "POST",
contentType: "application/json",
data: JSON.stringify(data1),
success:function(){
alert("success");
}
});
后台action
private list<ResContactInfo>resContactInfo;
后台有个resContactInfo属性 它的get set方法也写了
ResContactInfo这个类的属性为 metadataId 、orgCode等 同上面的json对象中的5个属性
问题 :我看到浏览器发的请求 感觉是没有问题的 但是后台显示接不到值 求解???
- 点赞
- 回答
- 收藏
- 复制链接分享
8条回答
为你推荐
- 如何使用Jquery和golang中的输入json数据进行Ajax调用?
- curl
- json
- ajax
- jquery
- 2个回答
- 如何从ajax数据创建jquery数组?
- ajax
- arrays
- php
- jquery
- 1个回答
- 需要修复Jquery错误:无效字符串JSON错误
- json
- php
- jquery
- 1个回答
- JQuery $ .ajax请求json响应
- json
- ajax
- php
- jquery
- 4个回答
- 无法在ajax调用后使用jquery解析json
- json
- javascript
- php
- jquery
- 1个回答