• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to iterate hashmap in jsp?  RSS feed

 
L Willie
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i want iterate hashMap(linkMap) of someForm at jsp.

thank for your guide.>
 
Vijitha Kumara
Bartender
Posts: 3993
31
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, using Java in JSPs is not a good practice. JSPs meant to be the view part of the application. Of course you can write Java inside JSPs (inside a scriptlet <% ..... %>) but as I said it's not done these days. You may use a combination of JSTL, EL, Custom tags and Standard actions to achieve the same. Checkout the JspFaq for more about those.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Get the JSTL set up as Vijitha Kumara correctly suggested, and use the <c:forEach> tag to iterate over the Map. Be aware that for each iteration, the iteration item will be an instance of Map.Entry.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!