//将需要的参数转成json字符串,然后用utf-8编码 var obj = encodeURIComponent(JSON.stringify(this.categories),"utf-8")
//后台将前台的json字符串按照utf-8的格式解码,然后进行转换 @RequestMapping(value = "/updateMaterialDemoInfo.do", method = RequestMethod.POST)@ResponseBodypublic Map<String, Object> updateMaterialDemoInfo(String obj){List<MaterialDemoInfoDTO> list = new ArrayList<MaterialDemoInfoDTO>();try {String param = URLDecoder.decode(obj,"utf-8");list = (List<MaterialDemoInfoDTO>)JSonUtil.json2Obj(param, MaterialDemoInfoDTO.class);} catch (Exception e) {// TODO Auto-generated catch block e.printStackTrace();}return materialDemoService.updateMaterialDemoInfo(list);}
public class MaterialDemoInfoDTO {// 主键IDprivate String id;//路径private String [] path;//物资器材模板idprivate String demoId;//数量private String num;//序号private String sort;//类型备注private String remark;