title: Velocity, how to retrieve a hashmap value using another velocity variable
body: <p>I have a HashMap in my bean:</p>
  
  <pre><code>HashMap&lt;String, SomeObject&gt; someHashMap;
  </code></pre>
  
  <p>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):</p>
  
  <pre><code>$key
  </code></pre>
  
  <p>How can I access the hashmap with this key? I'm trying:</p>
  
  <pre><code>$someHashMap.get($key)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>${someHashMap.get($key)}
  </code></pre>
  
  <p>But those two only write the same thing to the output, meaning that with the first line I literally get:</p>
  
  <pre><code>$someHashMap.get($key)
  </code></pre>
  
  <p>In the webpage.</p>
  
  <p>Which is the correct way/syntaxis to do this?</p>
  
  <p>Thanks!</p>