前端部分:传入参数 "groupObject" : jsonString
//对象序列化传参
var projectGroup = {};
projectGroup["id"] = id;
projectGroup["isEnable"] = isEnable;
projectGroup["employeeNo"] = employeeNo;
projectGroup["employeeName"] = employeeName;
projectGroup["centerName"] = centerName;
projectGroup["deptName"] = deptName;
projectGroup["projectInfoNo"] = projectInfoNo;
projectGroup["centerId"] = centerId;
projectGroup["deptId"] = deptId;
projectGroup["employeeImg"] = employeeImg;
var jsonString = JSON.stringify(projectGroup);
后端部分:接收参数 String groupObject;
// json串转指定bean
projectGroup projectGroup2 = null;
try {
projectGroup2 = new ObjectMapper().readValue(groupObject, projectGroup.class);
} catch (IOException e) {
e.printStackTrace();
}