SpringBoot 如何从前台传递数组
1.SpringBoot 如何从前台传递数组
2、前台
$.ajax({ url: 'deleteBsGiftById', type: 'post', dataType: 'json', data: { ids: idArray }
)}
3、后台接收
@PostMapping("deleteBsGiftById")
@ResponseBody
public boolean deleteBsGiftById(@RequestParam(value = "ids[]") String[] ids) {
return true;
}
4、@RequestBody 接收数组 前台需要传递Json类型
后台:
@RequestMapping("deleteVillages") public JSONObject deleteVillages(@RequestBody String[] id){}
前台:

但行好事,相信技术,转载请注明出处

浙公网安备 33010602011771号