標籤:rom class sep success post back async code func
前台代碼
$.ajax({ url : ‘<%=basePath%>userorderother/canUpdateCust.do‘, type : ‘POST‘, data: {‘kdcompany‘:kdcompany, ‘kdcardid‘:kdcardid, ‘odid‘:odid}, async : false, success : function(data) { location.reload(); } });
後台代碼
/**修改地址資訊 * @param * @throws Exception */ @RequestMapping(value="/canUpdateCust") @ResponseBody public PageData canUpdateCust() throws Exception{ PageData pd = new PageData(); pd = this.getPageData(); try { PageData custData = new PageData(); 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"); return pd; }
jsp傳給java屬性,java產生json串,方便以後取出來