How do I correct this statement:
${model.myHashtable[model.data.id]}.
myHashtable is defined as
Hashtable
${''.concat(model.data.id)} works for me,you may try it.
Set it as body of <c:set>
. It will implicitly be converted to String
.
<c:set var="idAsString">${model.data.id}</c:set>
<c:out value="${model.myHashtable[idAsString]}" />
you can use org.apache.commons.collections4.map.CaseInsensitiveMap both String "1" and int 1 are the same key;
In JSP file:
<%@ taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt" %>
<!-- lines of code... -->
<fmt:parseNumber var = "id_value" type = "number" value = "${model.data.id}" />
<c:out value = "${id_value}" />