关于springmvc的包含list提交的格式

<%--
Created by IntelliJ IDEA.
User: jh
Date: 2017/7/12
Time: 14:31
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>submitUserList_3</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script language="JavaScript" src="https://code.jquery.com/jquery-3.2.1.min.js" ></script>
<script language="JavaScript" src="https://cdn.bootcss.com/jquery-json/2.6.0/jquery.json.min.js" ></script>
<script type="text/javascript" language="JavaScript">
function submitUserList_3() {
var customerArray = new Array();
customerArray.push({groupNo: 1234, configGroup: "2",configKey: "2011,2012",configValue:"2011 - 11,2013 - 22", configdescription: "qwertyui"});
customerArray.push({groupNo: 5678, configGroup: "2",configKey: "2011,2012",configValue:"2011 - 11,2013 - 22", configdescription: "qwertyussghji"});
var sysConfigList = customerArray/* {
cardLevelName: "测试接口一",
partnerName:"渠道一"
};*/
$.ajax({
url: "/sysig/insertSysConf",
type: "POST",
contentType : 'application/json;charset=utf-8', //设置请求头信息
dataType:"json",
//data: JSON.stringify(customerArray), //将Json对象序列化成Json字符串,JSON.stringify()原生态方法
data: $.toJSON(sysConfigList), //将Json对象序列化成Json字符串,toJSON()需要引用jquery.json.min.js
success: function(data){
alert(data);
alert("ok");
},
error: function(res){
alert(res.responseText);
}
});
}
</script>
</head>

<body>
<h1>submitUserList_3</h1>
<input id="submit" type="button" value="Submit" onclick="submitUserList_3();">
</body>
</html>
原文地址:https://www.cnblogs.com/liuruilongdn/p/8087264.html