title: freemarker template syntax spring boot
body: <p>I have a springboot application that creates a hashmap. I want to create a table that has one header and multiple rows (one for each value in the map). The following code returns an ISE: </p>
  
  <blockquote>
    <p>There was an unexpected error (type=Internal Server Error,
    status=500). Failed to parse FreeMarker template for URL
    [toDoListView.ftl]; nested exception is
    freemarker.core.ParseException: Syntax error in template
    "toDoListView.ftl" in line 47, column 37: Encountered ">", but was
    expecting one of: ".."  "..<em>" "as" "." "[" "(" "?" "!"
     "??" "+" "-" "</em>" "/" "%" "!=" "=" "==" ">="
     ">"    
    </p>
  </blockquote>
  
  <p>line 47 is:&lt;#list itemMap></p>
  
  <pre><code>&lt;#if itemMap??&gt;
      &lt;table class="table table-bordered"&gt;
          &lt;#list itemMap&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;/th&gt;
                      &lt;th&gt;Item1&lt;/th&gt;
                      &lt;th&gt;Item2&lt;/th&gt;
                      &lt;th&gt;Item3&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
          &lt;#item?keys as key&gt;
              &lt;#if !itemMap?values[key_index].done&gt;
                  &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;td id="checkbox_column" width="40"&gt;
                              &lt;input type="checkbox" name="im" value="${key}"&gt;
                          &lt;/td&gt;
                          &lt;#if itemMap?values[key_index].color == "BLUE"&gt;
                              &lt;td&gt;${itemMap?values[key_index].blue}&lt;/td&gt;
                          &lt;#elseif itemMap?values[key_index].color == "RED"&gt;
                              &lt;td&gt;${itemMap?values[key_index].red}&lt;/td&gt; 
                          &lt;/#if&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/#if&gt; 
          &lt;/#item?keys&gt;
      &lt;/table&gt;
  &lt;#else&gt;
      No Items!
  &lt;/#list&gt;
  </code></pre>
  
  <p>I am not sure what is causing this error. I was trying to follow the example listed here under Form 2: <a href="http://freemarker.org/docs/ref_directive_list.html" rel="nofollow">http://freemarker.org/docs/ref_directive_list.html</a></p>