Ajax
1 $.ajax({ 2 async: false, 3 cache: false, 4 type: 'post', 5 data: { 6 featureId: objectId, 7 }, 8 // dataType: "json", 9 url: baseConfig.webRoot + "/" + type + "/deletegrid",//请求的action路径 10 error: function () {//请求失败处理函数 11 // alert('请求失败'); 12 }, 13 success: function (data) { //请求成功后处理函数。 14 // alert("请求成功"); 15 } 16 });
后台接受:
1 @RequestMapping(value = "/deletegrid", method = RequestMethod.POST) 2 public 3 @ResponseBody 4 void deleteGridData(@RequestParam("featureId") String featureId) throws ParseException { 5 String idNum[] = featureId.split("\\."); 6 // System.out.println(points); 7 8 long qdId = Long.parseLong(idNum[1]); 9 10 wgczService.deleteWgczData(qdId); 11 12 13 }
越努力 越幸运