Description
I have a selectManyCheckBox backed by an Integer array property. When the form is submitted, I get an exception thrown when updating the model:
Caused by: javax.servlet.jsp.el.ELException: Attempt to coerce a value of type "[Ljava.lang.Object;" to type "[Ljava.lang.Integer;"
It seems that the property is trying to be set with an Object array, rather than Integer array.
I have tracked the problem down to _SharedRendererUtils:
...
{
//Object array
int len = submittedValue.length;
Object[] convertedValues = new Object[len];
for (int i = 0; i < len; i++)
return convertedValues;
}
..
Given that we know what type the array should be, a suggested patch for the code is:
int len = submittedValue.length;
ArrayList convertedValues = new ArrayList(len);
for (int i = 0; i < len; i++)
return convertedValues.toArray((Object[]) Array.newInstance(arrayComponentType, len));
Peter