Since including <mvc:annotation-driven/> I have experienced a problem when binding the selections of multi-select list box to its corresponding list property on the command bean. Before introducing <mvc:annotation-driven/> it worked correctly.
I have a custom collection editor:
which previously would result in the form controller receiving a List<Field> representing the list selections. However, since using the <mvc:annotation-driven/> what I now get is a List<List<Field>>.Code:@InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(List.class, new CustomCollectionEditor(List.class) { protected Object convertElement(Object element) { String fieldName = (String)element; for (Field field : fields) { if (field.getFieldName().equals(fieldName)) return field; } return element; } }); }
Can anyone help shed light on this behaviour?


Reply With Quote
