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
Map
${map}
${key}
You can put the key-value in a map on Java side and access the same using JSTL on JSP page as below:
Java
JSTL
JSP
Prior java 1.7:
Map map = new HashMap(); map.put("key","value");
Java 1.7 and above:
Map map = new HashMap<>(); map.put("key","value");
JSP Snippet: