How can I get value from ArrayList or HashMap using JSTL?
843840Oct 26 2007 — edited Oct 26 2007I 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