Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

getting value from hashmap in JSP using struts tag

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a hashmap which has object in its value, I want to display value for the key passed in JSP.

E.g HashMap is hm and it has object obj which is like

class Obj{
private string id;
private String name;

getter setter for these two.....
}
hm.put ("1", obj)
hm.put("2",obj)

Now in JSP I want to display name for the object with key 1 and key 2.

When I try like this <html:text property="hm.1" /> it gives object, but I want to display name in object with key 1.....

Please suggest solution for this...

Thanks in advance.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic