前言:

1,参考博客:解决JavaScript中使用$.ajax方式提交数组参数 - Just_Do - 博客园(http://www.cnblogs.com/caoyc/p/5710702.html

2,解决方案:添加traditional : true

正文:

js:

    var array = [];
    $("input").each(function(){
        array.push($(this).val());
    });

    $.ajax({
        type : "GET",
        traditional : true,//数组
        url : "/url",
        data : {
            "array" : array
        },
        success : function(list) {
            
        }
    });

后台:

   @ResponseBody
    @RequestMapping(value = "url", method = RequestMethod.GET)
    public void followDoctorList(String[] array)
    {
    }

 

相关文章:

  • 2021-07-16
  • 2021-12-26
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2021-10-12
猜你喜欢
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
相关资源
相似解决方案