Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I get value from ArrayList or HashMap using JSTL?

843840Oct 26 2007 — edited Oct 26 2007
I wanna use Array.get(i) in JSP code using JSTL and JavaBeans.

In JSTL, we can write like this, if that is just array

<c:forEach begin="0" end="${cart.size}" step="1" var="i">
${ cart.items[ i ] }
</c:forEach>

but, I creat ArrayList in my JavaBean and I tried to write like this,

<c:forEach begin="0" end="${cart.size}" step="1" var="i">
${cart.items.get(i)}
</c:forEach>

but error showed up.

How can I call specific value from ArrayList?
and also, I made HashMap, how can I use hash.get(key).get(value)??

Edited by: hikkyi on Oct 26, 2007 9:43 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2007
Added on Oct 26 2007
9 comments
3,111 views