*
The moose likes Struts and the fly likes Get Hashmap value based on bean value. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Get Hashmap value based on bean value." Watch "Get Hashmap value based on bean value." New topic
Author

Get Hashmap value based on bean value.

Wes Hughes
Ranch Hand

Joined: Jul 29, 2002
Posts: 31
In my jsp I have a collection of beans and a hashmap. One of the things that I need to display is the name, e.g.

Note that the beanA contains a beanB. Now what I want to is get a value out of my hashmap based on beanB.id. Theoretically, I want something like:

Which I know doesn't work. I had to resort to using bean efine to define the id as a scripting variable and then using a scriplet to display the hashmap, e.g.

I want to avoid scriptlets but can't figure out how to do this.
[ July 31, 2003: Message edited by: Wes Hughes ]
[ July 31, 2003: Message edited by: Wes Hughes ]
[ July 31, 2003: Message edited by: Wes Hughes ]
[ July 31, 2003: Message edited by: Wes Hughes ]
 
Don't get me started about those stupid light bulbs.
 
subject: Get Hashmap value based on bean value.
 
Similar Threads
bean:define with bean:write
logic:iterate hashmap with key of hashmap
bean:define and hash map
logic:iterate on OrderedMap
bean:define not working in logic:iterate