使用spring接收客户端jquery ajax提交的数组参数 方法:
//客户端请求的数组格式为http://../../update?nodes=201,202.........为字符串数组 @RequestMapping(value = "update",method=RequestMethod.POST) public List<Region> update( @RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "type", required = true) Integer type, //方法一 使用 HttpServletRequest request, HttpServletRequest request, //方法二 使用如下代码绑定参数 @RequestParam(value = "nodes", required = true) String [] ids, Model model) { //方法一获取客户端数组 String [] nodes =request.getParameterValues("nodes"); return regions; }
?