I want to read data from a HashMap
using EL in a JSP page, but without the use of JSTL <c:forEach>
or a for
loop. How can I do this?
Asked
Active
Viewed 5.1k times
24

BalusC
- 1,082,665
- 372
- 3,610
- 3,555

Ankur Mukherjee
- 3,777
- 5
- 32
- 39
1 Answers
62
Just use the map key as if it were a bean property:
${map.key}
This does under the covers the same as map.get("key")
.
Or via the brace notation if the key contains dots:
${map['key.with.dots']}
This does under the covers the same as map.get("key.with.dots")
.
Or if the key is another variable:
${map[dynamicKey]}
This does under the covers the same as map.get(dynamicKey)
.

BalusC
- 1,082,665
- 372
- 3,610
- 3,555