Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path-binding does not work when conversionService is used and the last path element is of array type [SPR-6501] #11167

Closed
spring-projects-issues opened this issue Dec 2, 2009 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 2, 2009

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants