OgnlUtil.setValue(property, bean, valueOrValues.toArray());
Object[] typedArray = (Object[]) Array.newInstance(valueType, valueOrValues.size()); OgnlUtil.setValue(property, bean, valueOrValues.toArray(typedArray));
    protected void bindNonNullValue(ActionBean bean,                                    String property,                                    List<Object> valueOrValues,                                    Class targetType) throws Exception {        Class valueType = valueOrValues.iterator().next().getClass();        // If the target type is an array, set it as one, otherwise set as scalar        if (targetType.isArray() && !valueType.isArray()) {            OgnlUtil.setValue(property, bean, valueOrValues.toArray());        }        else if (Collection.class.isAssignableFrom(targetType) &&                !Collection.class.isAssignableFrom(valueType)) {            Collection collection = null;            if (targetType.isInterface()) {                collection = (Collection) ReflectUtil.getInterfaceInstance(targetType);            }            else {                collection = (Collection) targetType.newInstance();            }            collection.addAll(valueOrValues);            OgnlUtil.setValue(property, bean, collection);        }        else {            OgnlUtil.setValue(property, bean, valueOrValues.get(0));        }    }