tags:

views:

58

answers:

2

I have Vector of Hashtables and each hash table has two elements with keys 'key1' and 'key2'.

Now in the jsp page i have to iterate those vector and print those values in the hash table using jstl tag c:forEach

Could anybody helps how to do that using c:forEach

+1  A: 
 <c:forEach items="${myVector}" var="ht">
    <c:out value="${ht.key1}" />
    <c:out value="${ht.key2}" />
  </c:forEach>  

Try this way, here you should know the key names.

org.life.java
+2  A: 
<c:forEach items="${yourVector}" var="ht">
   <c:forEach items="${ht}" var="entry">
       <c:out value="${entry.key}" />
   </c:forEach>
</c:forEach>

Btw, use HashMap instead of Hashtable (and ArrayList instead of Vector)

Bozho
And `ArrayList` instead of `Vector`.
BalusC
thanx it works for me
Pawan