java object 前后台转换
jsp:
function createWaring(){
var updateMap = JSON.stringify(updateObj);
document.waring.action = path+"/task/saveWaring.action?updateMap="+updateMap;
document.waring.submit();
}
java:
JSONObject jsonObject = JSONObject.fromObject(vo.getUpdateMap());
List insertlist=new ArrayList();
List updatelist=new ArrayList();
Object c=null;
for(Object key:jsonObject.keySet()){
c=jsonObject.get(key.toString());
WaringModel wm = (WaringModel) JSONObject.toBean((JSONObject) c, WaringModel.class);
if(wm.getWaring_type()==1){
wm.setRole_id(vo.getRole_id());
insertlist.add(wm);
}else{
updatelist.add(wm);
}
}
相关推荐
WebVincent 2020-07-21
fengchao000 2020-07-04
baijinswpu 2020-06-28
88483063 2020-06-28
fengchao000 2020-06-16
somebodyoneday 2020-06-15
wujiajax 2020-06-14
somebodyoneday 2020-05-16
xx0cw 2020-05-16
newthon 2020-05-14
sailxu00 2020-04-27
fengchao000 2020-04-20
88483063 2020-01-29
83163452 2020-01-28
baijinswpu 2020-01-25
baijinswpu 2020-01-18