SpringMVC提交参数绑定list时,默认配置如果list大小超过256,就会报错
来源:互联网 发布:强行卸载软件 编辑:程序博客网 时间:2024/04/30 12:54
使用SpringMVC提交数组时,如果list/array 大小超过256,就会报错。
原因是DataBinder 中默认限制了list最大只能增长到256。
原因是DataBinder 中默认限制了list最大只能增长到256。
private int autoGrowCollectionLimit = DEFAULT_AUTO_GROW_COLLECTION_LIMIT;
解决方案:
1)在BaseController添加InitBinder方法,其余继承BaseController
@InitBinder
public void initBinder(WebDataBinder binder) {
binder.setAutoGrowCollectionLimit(Integer.MAX_VALUE);
}
2)增加一个WebBindingInitializer类,并在xml中配置。
public class DataBindingInitializer implements WebBindingInitializer {
@Override
public void initBinder(WebDataBinder binde) {
binder.setAutoGrowCollectionLimit(Integer.MAX_VALUE);
}
}
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="xxx.DataBindingInitializer"/>
</property>
</bean>
0 0
- SpringMVC提交参数绑定list时,默认配置如果list大小超过256,就会报错
- SpringMVC提交参数绑定list时,默认配置如果list大小超过256,就会报错
- 使用SpringMVC提交数组时,如果list大小超过256,就会报错。
- SpringMVC前台提交参数绑定list时大小超过256 java.lang.IndexOutOfBoundsException解决办法
- SpringMvc绑定字符串数组和List参数
- springmvc(十五)springmvc注解开发-springmvc参数绑定-list绑定
- springmvc传list参数
- Spring mvc 绑定list参数
- Spring mvc 绑定list参数
- List 转 jsonArray 会报错的原因
- 代码里不能写 ...... IN ()这种条件,如果参数>1000服务器就会报错,CPU占用会达到100%
- 通过网络请求获取数据时,如果立即使用就会报错:数据为空
- springMVC 接收List集合参数
- springmvc ajax 传递list参数
- SpringMVC框架前端传递List限制大小256问题
- SpringMVC框架前端传递List限制大小256问题
- springMVC中使用List和Map绑定对象作为参数的使用方法
- SpringMVC form表单提交list对象集合
- Java--Mac下JDK的安装路径
- C++工程师面试宝典系列之MFC开发
- POJ2777线段树
- 架构设计:系统间通信(18)——服务治理与Dubbo 下篇(继续分析)
- 微信小程序之相册选择,拍照
- SpringMVC提交参数绑定list时,默认配置如果list大小超过256,就会报错
- Android下打印调试堆栈方法
- Android技术之APP彻底退出
- Bootloader学习一
- 73. Set Matrix Zeroes
- Android-Touch-GestureDetector
- UVALive 3942 Remeber the Word Trie+递推
- 小P的故事——神奇的Dota(完全背包)
- String.getBytes()& JAVA编码转换的详细过程