title: Thymeleaf: "Exception evaluating OGNL expression" in a simple for loop
body: <p>I have this controller:</p>
  <pre><code>it.render(
     &quot;my-list.html&quot;,
     mapOf( 
        &quot;votes-positive&quot; to repo.votesOf(&quot;x&quot;),
    )
  )
  
  //...
  data class Vote(
     val name: String,
     val type: Type,
  ) {
     enum class Type { POS, NEG }
  }
  </code></pre>
  <p>my template file <code>&quot;my-list.html</code>:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;
  &lt;body&gt;
      &lt;div th:each=&quot;vote : ${votes-positive}&quot;&gt;
          &lt;span th:text=&quot;${vote.name}&quot;&gt;&lt;/span&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  <p>I'm getting this error when running it, which is driving me crazy:</p>
  <pre><code>[qtp119358627-23] ERROR org.thymeleaf.TemplateEngine - [THYMELEAF][qtp119358627-23] Exception processing template &quot;my-list.html&quot;: Exception evaluating OGNL expression: &quot;vote.name&quot; (template: &quot;my-list.html&quot; - line 21, col 15)
  org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating OGNL expression: &quot;vote.name&quot; (template: &quot;my-list.html&quot; - line 21, col 15)
  </code></pre>
  <p>Is there a Thymleaf debug mode? Is there a way to print the model tree? I don't know why the expression is wrong.</p>