Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hashtables in JSTL

 
raj sekhar
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Am trying to read from hashtable using JSTL tags in JSP. What I found when doing a c:forEach is , with Hastables, it returns lastIn firstOut order from the Hashtable when I do the looping. How can I reverse it. I wud like to have FirstInFirstOut Oreder. Here's the code snippet:

<c:forEach var="item" items="${testHash}">
The next Hash key is <c ut value = "${item.key}"/> <br/>
The next Hash value is <c ut value = "${item.value}"/> <br/>
</c:forEach>

Also is there a good reference site for EL and JSTL with lot of examples ?

Thanks for u time.
RS
 
Daniel Hedrick
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uh, you might want to check the API for Hashtable. AFAIK, it does not promise any type of ordering. If you want your elements in a particular order, use a Collection class that supports it.

Good luck!

-daniel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic