title: Retrieve a value from an HashMap in JSP page
body: <p>I have a problem. I tried every kind of solution that I found on Stackoverflow.
  I have this Java part of code:</p>
  
  <pre><code>Map&lt;String, ArchitetturaUnitaModel&gt; map = new HashMap&lt;String, ArchitetturaUnitaModel&gt;();
          if(!CollectionUtils.isEmpty(searchPageData.getResults())){
              for(ProductData result:searchPageData.getResults()){
                  if(result instanceof DocumentoData){
                      String unitaName = ((DocumentoData) result).getUnita();
                      ArchitetturaUnitaModel unita = fondoFacade.getUnitaByNameUnita(unitaName);
                      if(!map.containsKey(result.getCode())){
                          map.put(result.getCode(), unita);
                      }
  
                  }
  
              }
          }
  
          model.addAttribute("map", map);
  </code></pre>
  
  <p>In a JSP page I have this part of code, where I try to retrieve some data from the map, passing the key value:</p>
  
  <pre><code>&lt;c:set value="${map}" var="map"/&gt;
  
  
  
  &lt;c:forEach items="${searchPageData.results}" var="product" varStatus="status"&gt;
    &lt;c:set value="${product.code}" var="pcode"/&gt;
    &lt;c:set value="${map.get(pcode)}" var="unita"/&gt;
    &lt;b&gt;&lt;spring:theme code="text.titolounita" /&gt;: &lt;/b&gt;&lt;c:out value="${unita.nome}"/&gt; &lt;br&gt;
    &lt;b&gt;&lt;spring:theme code="text.documento" /&gt;: &lt;/b&gt;${product.name} &lt;br&gt;
    &lt;b&gt;&lt;spring:theme code="text.lineaferroviaria" /&gt;: &lt;/b&gt;&lt;c:out value="${unita.lineaFerroviaria}"/&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>But I can't obtain nothing from the value <em>unita</em>.
  If I print the map variable I obtain this:</p>
  
  <blockquote>
    <p>{123123123=ArchitetturaUnitaModel (8796158591118)}</p>
  </blockquote>
  
  <p>How I have to write to take the value from the map?</p>