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){}

前台:

SpringBoot 如何从前台传递数组

 

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2021-09-14
  • 2021-11-24
  • 2022-12-23
  • 2021-08-14
  • 2022-01-09
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案