Yes, this is perfectly acceptable.
When you use <c:forEach>
to iterate over a Map
, each item in the iteration is an instance of Map.Entry
. So given your example:
<c:forEach var="type" items="${types}"> Key is ${type.key} Value is ${type.value}</c:forEach>