This is documented in the logic taglib reference. Here's the relevant section:

-----
Normally, each object exposed by the iterate tag is an element of the 
underlying collection you are iterating over. However, if you iterate over 
a Map, the exposed object is of type Map.Entry that has two properties:

key - The key under which this item is stored in the underlying Map.
value - The value that corresponds to this key.

So, if you wish to iterate over the values of a Hashtable, you would 
implement code like the following:

<logic:iterate id="element" name="myhashtable">
Next element is <bean:write name="element" property="value"/>
</logic:iterate>
-----

Hope this helps.

--
Martin Cooper


At 01:43 PM 6/8/01, John J. Thomas wrote:
>We have written XML driven data access components that implement the
>Collection interface. A data access object retrieves data from the JDBC
>ResultSet then uses the query's metadata to load the rows into HashMaps.
>Each database row is stored in a HashMap. All said and done, we have a
>collection of HashMaps.
>
>Now, how do we access the HashMap's values in the logic:iterate tag? The
>traditional bean:write tag wants a bean but we have a HashMap? We have
>looked through Apache Tablibs but we haven't found any existing tag to
>handle an existing HashMap. If there is no existing way to get to this data,
>we can write such a tag.
>
>Thanks,
>
>JT


Reply via email to