title: Thymeleaf iterating through list of objects shows blank
body: <p>I am trying to iterate through objects passed through ModelMap using Spring MVC. However, the text shows up blank when tested on browser. For example : </p>
  
  <p>test.jsp :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  Hello ${test}  
  
  &lt;tr th:each="user,iterStat : ${testList}"&gt;
      &lt;td th:text="${user.id}" /&gt;
      &lt;td th:text="${user.name}" /&gt;
  &lt;/tr&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Controller code : </p>
  
  <pre><code>@GetMapping("/test")
  public String test(Model model) {
      model.addAttribute("test", "Bob");
      List&lt;ChatUser&gt; users = new ArrayList&lt;&gt;();
      users.add(new ChatUser("asdf"));
      users.add(new ChatUser("ewfasdf"));
      model.addAttribute("testList", users);
      return "test";
  }
  </code></pre>
  
  <p>When loading up /test after deploying my webapp I would see Hello Bob, but nothing else. Checking the source of the webpage I see this : </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  Hello Bob
  
  &lt;tr th:each="user,iterStat : [com.mkyong.ChatUser@7a5dd809, com.mkyong.ChatUser@61f4628]"&gt;
      &lt;td th:text=""/&gt;
      &lt;td th:text=""/&gt;
  &lt;/tr&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>As seen in the th:each line, the objects are obviously being passed through properly. But the th:text is showing up just blank. </p>
  
  <p>My ChatUser entity : </p>
  
  <pre><code>@Entity
  public class ChatUser {
      @Id
      @Column
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
      @Column
      private String name;
  
      public ChatUser() {}
  
      public ChatUser(String name) {
          this.name = name;
  
      }
      public Long getId() {
          return id;
      }
      public void setId(Long id) {
          this.id = id;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
  }
  </code></pre>
  
  <p>What is the issue here?</p>