$('#saveBtn').click(function(){ if($('#myform').form('validate')){ var j = {}; var params = $('#myform').serializeArray(); for (var item in params) { var name = params[item].name; var value = params[item].value; if (name == 'tag') { j['nodeTag'] = value; } else if(name == 'autoId') { j['autoId'] = value; }else if (name == 'type'){ j['nodeType'] = value; }else if(name == 'value'){ j['nodeValue'] = value; }else if(name == 'remark'){ j['nodeRemark'] = value; } } $.ajax({ type: 'post' , url: flag=='add'?'${ctx}/sys/dict/save':'${ctx}/sys/dict/update', cache:false , // data:$('#myform').serialize() , data:JSON.stringify(j), dataType:'json' , headers:{ Accept:"application/json", "Content-Type":"application/json" }, success:function(result){ //1 关闭窗口 $('#mydialog').dialog('close'); //2刷新datagrid $('#dictList').datagrid('reload'); //3 提示信息 $.messager.show({ title:result.success , msg:result.msg }); } , error:function(result){ $.meesager.show({ title:result.success , msg:result.msg }); } }); } else { $.messager.show({ title:'提示信息!' , msg:'数据验证不通过,不能保存!' }); } }); spring mvc接收json数据 @RequestMapping(value = "/update") @ResponseBody public JsonVO updateDict(@RequestBody PubsDicModel dict) { JsonVO j = new JsonVO(); try { // pubsDicService.updateDict(dict); j.setSuccess(true); j.setMsg("更新成功"); } catch (Exception e) { j.setMsg("更新失败"); } return j; }