This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Spring Combobox selection with HashMap entries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring Combobox selection with HashMap entries" Watch "Spring Combobox selection with HashMap entries" New topic
Author

Spring Combobox selection with HashMap entries

sudheshna Iyer
Ranch Hand

Joined: Aug 20, 2004
Posts: 71
Problem in diplaying and collecting values from jsp combo box:

I have the following in jsp:

<c:if test="${not empty customer.states}">
<form:select path="state" items="${customer.states}"/>
</c:if>

Customer:
HashMap<String, String> state (stateCode, stateDesc)==> Should contain seleted value

HashMap<String, String> states ==> Contains list of stateCode, stateDesc

org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'command' on field 'state': rejected value [IT012]; codes [typeMismatch.command.state,typeMismatch.state,typeMismatch.java.util.HashMap,typeMismatch]; arguments [org.springframework.context.sup
port.DefaultMessageSourceResolvable: codes [command.state,state]; arguments []; default message [state]]; default message [Failed to convert property value of type [java.lang.String] to required type [java.util.Hash
Map] for property 'state'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [
java.lang.String] to required type [java.util.HashMap] for property 'state': no matching editors or conversion st
rategy found]

I guess I have to set up property editors. Is that correct? If yes, can anybody provide simple example of setting up
property editors?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Combobox selection with HashMap entries
 
Similar Threads
I am getting error when starting Tomcat .How can I rectify it?
Need Help!!!!: Issues Deploying with Spring in JBoss
Capturing Checkbox value using spring framework
Struts email error message appearing twice
IllegalArgumentException: Cannot convert value of type [java.lang.String] to required