• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Hashtables in JSTL

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic