前言:
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) { }