Front Code
$.ajax ({ URL: '<%=basepath%>userorderother/ Canupdatecust.do ', type: ' POST ', data: {' Kdcompany ': Kdcompany, ' kdcardid ': Kdcardid, ' Odid ': Odid}, Async:false, success:function (data) { location.reload (); } });
Background code
/**Modify Address information *@param * @throwsException*/@RequestMapping (Value= "/canupdatecust") @ResponseBody PublicPagedata Canupdatecust ()throwsexception{pagedata PD=NewPagedata (); PD= This. Getpagedata (); Try{pagedata Custdata=NewPagedata (); Custdata.put ("ORDERID", Pd.get ("Odid")); Pd.remove ("OrderId"); Jsonobject Object=Jsonobject.fromobject (PD); Custdata.put ("Customermailing", object.tostring ()); Userorderotherservice.updatecust (Custdata); } Catch(Exception e) {pd.put ("Status", "Err"); Pd.put ("MSG", E.getmessage ()); } pd.put ("Status", "OK"); returnPD; }
JSP to Java properties, Java generated JSON string, easy to take out later