You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Dudley Butt@i-Commerce" <Du...@za.didata.com> on 2001/06/05 12:30:09 UTC

RE: Any Hashmap examples used in jsp page? - still not working

Hi all

Still not getting this hashmap thing write...here is what i'm trying to do.
I have a hashmap with a list of key-value pairs.

I don't want to go thru each element and list it, i just want to evaluate
the equivalent Java code : if (map.containsKey(LIC.LINE_TYPE)){ ....
I want to find out whether the map has a certain key in it, without having
to loop the whole way. I'm trying to use a logic:equals tag

help!!!



-----Original Message-----
From: Steve A Drake [mailto:sad@comet.ucar.edu]
Sent: Tuesday, June 05, 2001 3:17 AM
To: struts-user@jakarta.apache.org
Subject: RE: Any Hashmap examples used in jsp page?


On Mon, 4 Jun 2001, Deadman, Hal wrote:

> I don't think what you are trying to do should be done in the JSP by a
> struts/custom tag.

 Maybe it's a dumb idea, but that's never stopped me before. =:]

> Why not copy the value objects in the HashMap to an array based on the
order
> of the keys in your String array? Then pass the array to the JSP instead
of
> the HashMap. If you need the keys and they aren't attributes of the value
> objects then you can pass the String array of keys to the JSP too.

 I used an ArrayList of String[]s and that worked fine. Thanks.