js+springMVC 提交数组数据到后台的实例

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

js+springMVC 提交数组数据到后台的实例

```...简单点   2020-05-17 我要评论

1.ajax 代码

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

2.后台接收

  @RequestMapping(value = "https://img.qb5200.com/download-x/downReport", method = {RequestMethod.POST})
  @ResponseBody
  public Object downReport(@RequestParam(value = "downReportArray") Long[] downReportArray,HttpServletRequest request ) throws Exception {
     ...
  }

以上这篇js+springMVC 提交数组数据到后台的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们