I have a Map
in EL as ${map}
and I am trying to get the value of it using a key which is by itself also an EL variable ${key}
with the
$
is not the start of a variable name, it indicates the start of an expression. You should use ${map[key]}
to access the property key
in map map
.
You can try it on a page with a GET
parameter, using the following query string for example ?whatEver=something
whatEver:
This will output:
whatEver: something
See: https://stackoverflow.com/tags/el/info and scroll to the section "Brace notation".