Velocity, how to retrieve a hashmap value using another velocity variable
问题 I have a HashMap in my bean: HashMap<String, SomeObject> someHashMap; Then in the velocity template I need to access the HashMap with a value that I have in velocity from other source (in fact I have many keys not only one that's why I need to get the values this way): $key How can I access the hashmap with this key? I'm trying: $someHashMap.get($key) and ${someHashMap.get($key)} But those two only write the same thing to the output, meaning that with the first line I literally get: