title: Check inputs with type checkbox with thymeleaf
body: <p>I've been play around with spring-boot and thymeleaf; I'm trying to do a form where I will list numbers and the user will select them; however I would like to "checked" the third element (when equals 3) and I cannot see that the input is checked.</p>
  
  <p>I don't have problems loading the information and display the checkboxes, the problem came when I want to check one of them by default when the page loads.</p>
  
  <p>I need some help identifying what it should be the issue or if it is a bug with th:checked property.</p>
  
  <p>I have this in the controller</p>
  
  <pre><code>@ModelAttribute("allFeatures")
  public List&lt;Integer&gt; populateFeatures() {
      return  Arrays.asList(1, 2, 3, 4, 5, 6);
  }
  </code></pre>
  
  <p>Here is the html code</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li th:each="feat : ${allFeatures}"&gt;
          &lt;input type="checkbox" th:field="*{features}" th:value="${feat}" th:checked="${feat == 3}"&gt;&lt;/input&gt;
          &lt;label th:for="${#ids.prev('features')}" th:text="${'seedstarter.feature.' + feat}"&gt;Electric Heating&lt;/label&gt;
      &lt;/li&gt;
      &lt;li th:remove="all"&gt;
          &lt;input id="removed1" type="checkbox"/&gt; &lt;label for="removed1"&gt;Turf&lt;/label&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>