I am using Hashmap<String, String>
from the controller in the jsp. I need to parse the Hashmap and get the value passing the Key. I am trying to get the value by passing the key using the get method of hashmap, but it is not working.
var key = "keyString";
var valueStr = <%=hashMap.get(key)%>;
The above code is giving the error, key cannot be resolved to a variable. But when I am hardcoding the key value in the hashmap I am able to get the value.
var valueStr = <%=hashMap.get("keyString")%>;