当前位置 : 主页 > 编程语言 > c++ >

SpringMVC 接收 数组参数

来源:互联网 收集:自由互联 发布时间:2021-06-30
SpringMVC 接收 数组参数 @RequestMapping(value = "/xxx")@ResponseBodypublic Map queryXXX(@RequestParam(value = "payTypeList[]") String[] payTypeList, Model model) { }var url = "";var searchData = { payTypeList: $("#payType").val(), ...
SpringMVC 接收 数组参数
@RequestMapping(value = "/xxx")
@ResponseBody
public Map
 
   queryXXX(@RequestParam(value = "payTypeList[]") String[] payTypeList, Model model) {
    
}

var url = "";
var searchData = {
    payTypeList: $("#payType").val(),
    ...
};
// ["1","4","5"]
$.ajax({
    type: "POST",
    url: url,
    data: searchData,
    dataType:"json",
    success: function (msg) {
        
    }
});
 
网友评论