The incoming request has too many parameters. The server supports a maximum of 2100 parameters.
The incoming request has too many parameters. The server supports a maximum of 2100 parameters.
传入请求的参数太多。服务器最多支持2100个参数。
修改前:
Controller层代码:
List<HashMap<String, Object>> infoList=demoService.getInfoList();
demoService.updateInfo(infoList);
mybatis代码:
<insert id="insertInfo" parameterType="list">insert into tableA(columnA,columnB)values<foreach collection="list" item="item" index="index" separator=",">(#{item.parameterA},#{item.parameterB})</foreach>
</insert>
修改后:
pom文件引入jar包:
<dependency><groupId>org.apache.commons</groupId><artifactId>commons-collections4</artifactId><version>4.4</version>
</dependency>
修改Controller层代码:
List<HashMap<String, Object>> infoList=demoService.getInfoList();
//ListUtils.partition(list,n)按照制定长度n对list进行切割
//此处传参1000,取值标准:只要每个HashMap的参数总数*n<=2100即可,一般n取最大值
List<List<HashMap<String, Object>>> infoListTmp=ListUtils.partition(infoList, 1000);
for(int i=0;i<infoListNew.size();i++){demoService.updateInfo(infoListTmp.get(i));
}
PS:考虑博文简约,未做事务处理
总结:请求参数过多可分批进行处理,对于参数类型为list的情况,ListUtils.partition挺好用,不必自行循环切割(循环切割还需判断基数情况),其他类似于map/数组等传参方式亦是相同解决思路。
The incoming request has too many parameters. The server supports a maximum of 2100 parameters.相关推荐
- p2p webrtc服务器搭建系列1: 房间,信令,coturn打洞服务器
中继(relay) 在RTCPeeConnection中,使用ICE框架来保证RTCPeerConnection能实现NAT穿越 ICE,全名叫交互式连接建立(Interactive Connecti ...
- sql server 性能_SQL Server硬件性能调整
sql server 性能 SQL Server Performance Tuning can be a difficult assignment, especially when working w ...
- laravel $request 多维数组取值_大白话 Laravel 中间件
Laravel 中间件是什么? 简而言之,中间件在 laravel 中的作用就是过滤 HTTP 请求,根据不同的请求来执行不同的逻辑操作. 我们可以通过中间件实现以下功能: 指定某些路由 设置 HTT ...
- python request-urllib.request
urllib.request --- 用于打开 URL 的可扩展库¶ urllib.request 模块定义了适用于在各种复杂情况下打开 URL(主要为 HTTP)的函数和类 --- 例如基本认证.摘 ...
- ES新建模板时的错误 Client error: `PUT http://127.0.0.1:9200/_template/tmp` resulted in a `400 Bad Request`
跟着慕课网学习<Laravel快速开发简书>,搜索一章的时候,创建模板出现的错误总结: 模板文件: <?phpnamespace App\Console\Commands;use G ...
- Ajax.Request
Ajax.Request(url,{method:method,parameters:para,postBody:xmlString,asynchronous:true,setRequestHeade ...
- ajax.request函数使用详解
ajax.request函数使用详解 Ajax.Request ? Ajax.Request( url, { method:method, parameters:para, postBody:xmlS ...
- request method
An HTTP request is a class consisting of HTTP style requests, request lines, request methods, reques ...
- python request microsoft graph_Python request.headers方法代码示例
本文整理汇总了Python中flask.request.headers方法的典型用法代码示例.如果您正苦于以下问题:Python request.headers方法的具体用法?Python reque ...
最新文章
- 2018-2019-1 20165206 《信息安全系统设计基础》第4周学习总结
- [Android]用架构师角度看插件化(3)-Replugin 需要占坑跳转?
- HTML+CSS+JS实现 ❤️酷炫3D瀑布流动画特效❤️
- C盘pagefile.sys不可删除,解决磁盘占用太满的问题
- 优Tech分享|YouTube推荐系统算法梳理
- html的动态页面包含,在html页面中包含静态或动态页面方法
- C语言学习笔记(5)
- Window CE 驱动开发流程(Windows CE.5.0系统、pxa270平台)
- 荐书丨如何快速成为150万+小程序开发者中的一员
- php 三大魔术方法,PHP魔术方法
- node mysql菜鸟教程_Node.js Web 模块
- ADNI数据集阅读整理
- PHP OOP(面向对象)进阶知识之“Trait技术”
- CSDN/博客园复制代码空格报错问题解决
- 易观CTO郭炜:开源,不是天才的甜点,而是勤奋者的盛宴
- 求救 关于ORA-01115的错误
- MFC Windows 程序设计[192]之六只眼八卦图按钮组(附源码)
- android语音记账,爱彼语记语音计算器记账记事本
- GPU Profiling
- 【Linux】Linux 开放端口