Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iterating over hashmap using jstl

 
Saniya Ansari
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - i have a simple issue but a little new with JSTL.
I have a hashmap which contains a key (string value) and value (array list). I need to iterate such that i populate a html drop down list. The key will be displayed, the arraylist[0] and arraylist[1] values will be displayed as text on the HTML page.

Can anyone show me a simple example ....thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you worked out so far?
 
Saniya Ansari
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is what i have so far... but i'm wondering on how to get something like pet.value[0] (refering to the first value in the array list)
and then pet.value[1] i.e. the second value...
Should i extract out the array list as a variable using the <c:set> tag and print the value at index 0 and 1 from that...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please edit your post and add proper indentation to the code. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic