The options tag doesn't permit the use of a Hashmap. A Hashmap is not actually a
Collection, since it doesn't implement the Collection interface. Perhaps this
utility is a possible enhancement for the options tag.
----- Original Message -----
From: "Ganendran Kumaraswamy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 4:45 AM
Subject: Displaying a hashmap through html:options
I have created and set a hashmap called "hm" in the request object in my
action class. Action class forwards it to a JSP page. In the JSP page, I
have the following line to get the bean into the page.
<bean:define id="hmap" name="hm" scope="request" type="java.util.HashMap"/>
I am trying to populate the options tag using the data in the hashmap. I
want the keys of the hashmap to be the value of the <option> tag in html and
the value of the hashmap to be the displayed text.
Currently I have something like,
<html:select property="singleSelect" size="6">
<html:options collection="hmap" property="hmap" labelProperty="hmap" />
</html:select>
This doesnt seem to work. Any ideas ?