js+springMVC 提交数组数据到后台

1.ajax 代码

var ids =new Array();
$.ajax({
    type: "POST",
    url: "/user/downReport",
    dataType: "html",
    traditional: true,
    data:{
        downReportArray:ids
    },
    async: true,
    success: function (data) {
        if(data.code==200){
            console.log("正在打包...")
        }
    }
});

 

2.后台接收

    @RequestMapping(value = "/downReport", method = {RequestMethod.POST})
    @ResponseBody
    public Object downReport(@RequestParam(value = "downReportArray") Long[] downReportArray,HttpServletRequest request ) throws Exception {
       ...
    }

 

posted @ 2018-04-12 11:23  全栈九九六  阅读(2229)  评论(0编辑  收藏  举报