File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Hashtables in JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Hashtables in JSTL" Watch "Hashtables in JSTL" New topic

Hashtables in JSTL

raj sekhar
Ranch Hand

Joined: Oct 16, 2001
Posts: 117
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/>

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

Thanks for u time.
Daniel Hedrick

Joined: Aug 08, 2003
Posts: 10
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!


There are 10 types of people in this world...<br />Those who understand binary, and those who don't.
I agree. Here's the link:
subject: Hashtables in JSTL
It's not a secret anymore!