码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2017-12-22 19:51:57      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:jquer   ssg   online   error   array   cee   gpo   str   dea   

<%--
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:"李四渠道",
isCobranded:"2",
registerFee:"10",
effectiveDays:"100",
cardType:"1",
allowUseOnline:"1",
allowUseOffline:"1",
periodType:"1",
status:"1",
allowRenew:"1",
cardPriceEcardPolicyList: customerArray
};*/
$.ajax({
url: "/sysConfig/insertSysConfig",
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>

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

标签:jquer   ssg   online   error   array   cee   gpo   str   dea   

原文地址:http://www.cnblogs.com/liuruilongdn/p/8087264.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!