[email protected]
var param = {}; param.keys = delKeys.join();//delKeys是数组,如delKeys=[‘a‘,b‘,‘c‘],join函数把数组拼接成字符串,分隔符默认是, $.ajax({ type: "POST", data: param, dataType: "json",//预期服务器返回的数据类型 url: ctxpath+"/cache/deleteCache.action", success: function (serverData) { alertWin("成功删除"+serverData.data+"条"); search(); } });
@RequestMapping("/deleteCache.action")@ResponseBodyprivate PageResponse deleteCache(HttpServletRequest request,@RequestParam List<String> keys) { //keys可以得到正确的数组 //request.getParameter("keys") 得到的是"a,b,c"}
时间: 2024-10-12 13:54:31