Closed
Description
Bjarte Andre Eide opened SPR-6501 and commented
When trying to bind an html input field to to a bean, and when the last path element is an array (i.e. myBean.selected[0]), I get the following stack trace:
java.lang.IllegalArgumentException: The sourceType to convert to is required
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.core.convert.support.GenericConversionService.assertNotNull(GenericConversionService.java:235)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:118)
at org.springframework.validation.AbstractPropertyBindingResult.formatFieldValue(AbstractPropertyBindingResult.java:120)
at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:227)
at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:120)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:175)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:195)
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:161)
at org.springframework.web.servlet.tags.form.AbstractSingleCheckedElementTag.writeTagContent(AbstractSingleCheckedElementTag.java:84)
at org.springframework.web.servlet.tags.form.CheckboxTag.writeTagContent(CheckboxTag.java:52)
at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:91)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:78)
If conversionService is removed, and using properyEditors, the binding works fine.
Affects: 3.0 RC3
Issue Links:
- Add Formatter support to generic collections [SPR-6504] #11170 Add Formatter support to generic collections