———————code————————————-
//对象
var screenInfo={};
screenInfo.deviceId=deviceId;
screenInfo.deviceNumber=deviceNumber;
//数组部分
var routeScreenList = [];
var list = {};
list.stationId=stationId;
list.stationName=stationName;
routeScreenList.push(list);
var actionUrl='xxx';
$.ajax({
type: "post",
url:actionUrl,
contentType : 'application/json;charset=utf-8', //设置请求头信息
dataType:"json",
data:JSON.stringify({'configScreenInfo':screenInfo,
'listRoute':routeScreenList}),
success: function(data){
if(data!=null){
//-----
}
});
——————————后台部分—————————-
@RequestMapping(“updateScreen”)
@ResponseBody
public ConfigScreenInfo update(@RequestBody RouteScreenDto dto ) {
}
public class RouteScreenDto {
private ConfigScreenInfo configScreenInfo;
private List listRoute ;
public List getListRoute() {
return listRoute;
}
public void setListRoute(List listRoute) {
this.listRoute = listRoute;
}
public ConfigScreenInfo getConfigScreenInfo() {
return configScreenInfo;
}
public void setConfigScreenInfo(ConfigScreenInfo configScreenInfo) {
this.configScreenInfo = configScreenInfo;
}
}