title: how to render Map<String, String> to template and use there
body: <p>i am trying to render a key,value Map to a template and then show there in this way: </p>
  
  <pre><code>@(twittsIfollow: Map[String, String])
   .....
   @if(twittsIfollow != null) {
    @for((key, value) &lt;- twittsIfollow) {
      @key
      @value
     } 
   }
  </code></pre>
  
  <p>it says, it is wrong. is there a scala tag for Map keys values? </p>
  
  <p>here is my method: </p>
  
  <pre><code>public static Map&lt;String, String&gt; alltwitts(List&lt;Long&gt; otherIDs) {
      Map&lt;String, String&gt; results=new HashMap&lt;String, String&gt;();
      for (Long id: otherIDs) {
          Query selected_twitt = JPA.em().createQuery("select u.twitt from Twitt u where " + " u.whose = ?").setParameter(1, id);
          String twOwner = User.getOneUser(id);
          String twitt  = (String) selected_twitt.getSingleResult();
          results.put(twOwner, twitt);
      }
  
      return results;
  }
  </code></pre>
  
  <p>then i render to template in this place: </p>
  
  <pre><code>Map&lt;String, String&gt; twittsIfollow = Twitt.alltwitts(IDusersIamFollowing);
  return ok(microblog.render(twittsIfollow));
  </code></pre>
  
  <p>now it is saying: <code>[NonUniqueResultException: result returns more than one elements]</code></p>
  
  <p>thanks </p>