转载自: http://empirel.iteye.com/blog/1763010
最终拼成的串就是如下样式,(只作举例)
后台接收,不讨论任何框架,只需要HttpServletRequest即可
- var as = [];
- var temp = [];
- for ( var int = 0; int < 5; int++) {
- temp.push('{"k":');
- temp.push(int);
- temp.push(',"v":');
- temp.push(int);
- temp.push('}');
- as.push(temp.join(""));
- }
- //Jquery中的方法,具体参考Jquery API
- $.post(
- "servlet/AjaxServlet?m=putWarningRule",{"aa":as}
- );
最终拼成的串就是如下样式,(只作举例)
- {"k":0,"v":0}
后台接收,不讨论任何框架,只需要HttpServletRequest即可
- String[] jsonArr = request.getParameterValues("aa[]");