计算机专业论文 网站建设广州网站建设系统
使用SpringMVC或者SpringBoot提交数组时,如果list大小超过256,就会报错。
原因是DataBinder 中默认限制了list最大只能增长到256。
private int autoGrowCollectionLimit = DEFAULT_AUTO_GROW_COLLECTION_LIMIT;
解决方案:
在需要的Action中添加InitBinder方法。
@InitBinder
public void initBinder(WebDataBinder binder) {binder.setAutoGrowCollectionLimit(Integer.MAX_VALUE);
}