1. js代码
var cutTimeList = [];
for (i = 0; i < 5; i++) {
var cutTime = new Object();
cutTime.startPoint = 1+i;
cutTime.endPoint = 2+i;
cutTimeList.push(cutTime);
}
$.post('accurate_merge_ts.json',{cutTimeList:JSON.stringify(cutTimeList)},function(result){
if(result.status=='1'){
$.omMessageTip.show({title: tip, content: result.message, type:"success" ,timeout: time});
}else{
$.omMessageTip.show({title: tip, content: result.message, type:"error" ,timeout: time});
}
});
2. controller代码
@RequestMapping(value="accurate_merge_ts")
public void accurateMergeTs(
@RequestParam(value = "cutTimeList")String cutTimeList,
HttpServletRequest request,HttpServletResponse response){
Boolean flag = true;
String notice= "成功";
List<CutTime> cutTimes = (List<CutTime>) JSONArray.parseArray(cutTimeList, CutTime.class);
JsonResult jsonResult=new JsonResult(flag, notice);
RenderUtil.renderJson(JsonUtils.toJson(jsonResult), response);
}