title: Cannot list a hash on key-value pairs in Freemarker
body: <p>What's wrong with the following template?</p>
  
  <pre><code>package ${packageName}
  
  public interface ${entityName} {
  
  &lt;#list methods as methodName, map &gt;
  public void ${methodName}(${map}) ;
  &lt;/#list&gt;
  
  }
  </code></pre>
  
  <p>which gives on version 2.3.23:</p>
  
  <pre><code>freemarker.core.ParseException: Syntax error in template "javaclass.ftl" in line 5, column 29:
  Encountered ",", but was expecting:
      "&gt;"
      at freemarker.core.FMParser.generateParseException(FMParser.java:5251)
      at freemarker.core.FMParser.jj_consume_token(FMParser.java:5122)
      at freemarker.core.FMParser.List(FMParser.java:1431)
      at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2827)
      at freemarker.core.FMParser.MixedContent(FMParser.java:3081)
      at freemarker.core.FMParser.OptionalBlock(FMParser.java:3253)
      at freemarker.core.FMParser.Root(FMParser.java:3432)
      at freemarker.template.Template.&lt;init&gt;(Template.java:208)
      at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:495)
  </code></pre>
  
  <p>The documentation <a href="http://freemarker.org/docs/ref_directive_list.html#ref.directive.items" rel="nofollow noreferrer">gives the following example</a> for a hash structure</p>
  
  <blockquote>
    <p>Listing hashes is very similar, but you need to provide two variable
    names after the as; one for the hash key, and another for the
    associated value. Assuming products is { "apple": 5, "banana": 10,
    "kiwi": 15 }:</p>
  
  <pre><code>&lt;#list products as name, price&gt;
    &lt;p&gt;${name}: ${price}
  &lt;/#list&gt;
  
    &lt;p&gt;apple: 5
    &lt;p&gt;banan: 10
    &lt;p&gt;kiwi: 15
  </code></pre>
  </blockquote>
  
  <p>Note that my example is before submitting content.</p>