
| Key: |
SPR-3612
|
| Type: |
Improvement
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Pedro Vicente
|
| Votes: |
1
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Virtual Machine: |
Sun JVM
- 1.4.2
|
| Platform: |
BEA WebLogic
- 8.1
|
|
When using the select form we cannot pass the items as a Collection of Map, the items must be a java bean.
For example in this case the countries variable is a List of Map objects
<form:select path="countryCode" items="${countries}" itemLabel="description" itemValue="country_code"></form:select>
The itemLabel "description" and itemValue "country_code" should be the keys of the Map, but the page gives the following error
org.springframework.beans.NotReadablePropertyException: Invalid property 'country_code' of bean class [org.apache.commons.collections.map.ListOrderedMap]: Bean property 'country_code' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:478)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:470)
at org.springframework.web.servlet.tags.form.OptionWriter.doRenderFromCollection(OptionWriter.java:150)
at org.springframework.web.servlet.tags.form.OptionWriter.renderFromCollection(OptionWriter.java:136)
at org.springframework.web.servlet.tags.form.OptionWriter.writeOptions(OptionWriter.java:99)
at org.springframework.web.servlet.tags.form.SelectTag.writeTagContent(SelectTag.java:197)
at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:82)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:68)
.....
Should the method doRenderFromCollection in the class OptionWriter check to see if the item is a instance of Map and extract the values of the Map instead?
If you agree with this change I can provide a patch.
Thanks
|
|
Description
|
When using the select form we cannot pass the items as a Collection of Map, the items must be a java bean.
For example in this case the countries variable is a List of Map objects
<form:select path="countryCode" items="${countries}" itemLabel="description" itemValue="country_code"></form:select>
The itemLabel "description" and itemValue "country_code" should be the keys of the Map, but the page gives the following error
org.springframework.beans.NotReadablePropertyException: Invalid property 'country_code' of bean class [org.apache.commons.collections.map.ListOrderedMap]: Bean property 'country_code' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:478)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:470)
at org.springframework.web.servlet.tags.form.OptionWriter.doRenderFromCollection(OptionWriter.java:150)
at org.springframework.web.servlet.tags.form.OptionWriter.renderFromCollection(OptionWriter.java:136)
at org.springframework.web.servlet.tags.form.OptionWriter.writeOptions(OptionWriter.java:99)
at org.springframework.web.servlet.tags.form.SelectTag.writeTagContent(SelectTag.java:197)
at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:82)
at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:68)
.....
Should the method doRenderFromCollection in the class OptionWriter check to see if the item is a instance of Map and extract the values of the Map instead?
If you agree with this change I can provide a patch.
Thanks
|
Show » |
|
Shouldn't be possible to use a Collection of Map's?
This will be very helpful when using the queryForList of the SqlTemplate.
Now we must convert the columns to some kind of object for all the lookups.