Access hashmap value by variable in JSP -


i have hashmap, put request:

hashmap<integer, string> mymap = ... request.setattribute("mymap", mymap); 

in jsp have foreach loop

<c:foreach items="${list}" var="item" varstatus="status">    <c:out value="${item.description}"/>    <c:out value="${mymap[item.id]}"/> </c:foreach> 

but ${mymap[item.id]} not work. how can access hashmap's value item.id variable ?

in el, numbers treated long. change map map<long, string> , it'll work.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -