Spring receives more than 256 of the foreground data with the following exception:
Org.springframework.beans.InvalidPropertyException:Invalid property ' specificationvalues[256] ' of Bean class [ Com.sencloud.entity.Specification]: Index of out of bounds in property path ' specificationvalues[256] '; Nested exception is java.lang.indexoutofboundsexception:index:256, Size: 256org.springframework.beans.beanwrapperimpl.getpropertyvalue (beanwrapperimpl.java:811) Org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper (beanwrapperimpl.java:554)
Traced the code of Spring, found the DataBinder, first explain the role of the DataBinder class, see links
Http://docs.spring.io/spring/docs/1.2.x/api/org/springframework/validation/DataBinder.html
There is one sentence
Binder that allows-binding property values to a target object. The binding process can be customized through specifying allowed fields, required fields, and custom editors. Note that there is potential security implications in failing to set a array of allowed fields. In the case of HTTP form POST data For example, malicious clients can attempt to subvert a application by supplying value s for fields or properties that does not exist on the form. In some cases this could leads to illegal data being set on command objects or their nested objects. For this reason, it's highly recommended to specify the Allowedfields property on the DataBinder.
Probably means that the foreground form element is bound to the background of the Javebean object, doing a mapping, but the list length of this map can not exceed 256
The source of the anti-compilation is as follows:
The fix is as follows: Autogrowcollectionlimit under Reset, set 1024 or greater when binding
/** * Due to spring's acceptance of the list at the foreground, a 256 indexoutofboundsexception exception will appear * Set Setautogrowcollectionlimit to 1024x768 * @param Binder * @see [Class, Class # method, Class # member] * /@InitBinder public void Initlistbinder (Webdatabinder binder) { //Set the number of elements that need to be wrapped, default to Binder.setautogrowcollectionlimit (1024x768); }
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"Spring" java.lang.indexoutofboundsexception:index:256, size:256