title: How to access inner objects in Thymeleaf?
body: <p>I am trying to Iterate a List if <code>User</code>s using thymeleaf,</p>
  
  <p>My <code>User</code> object is like this</p>
  
  <pre><code>public class User implements java.io.Serializable {
  
      private Integer userId;
      private Department department;
      private String email;
      // setters and getters etc
  }
  </code></pre>
  
  <p>and department object is like this</p>
  
  <pre><code>public class Department implements java.io.Serializable {
  
      private Integer departmentId;
      private String name;
      // setters and getters etc
  }
  </code></pre>
  
  <p>in thymeleaf I do this</p>
  
  <pre><code>&lt;tr th:each="user : ${users}"&gt;
      &lt;td th:text="${user.email}"&gt;&lt;/td&gt;
      &lt;td th:text="${user.department.name}"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>and I am getting this error </p>
  
  <pre><code>org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "user.department.name"
  </code></pre>
  
  <p>if I use only <code>user.email</code>, there is no issues.</p>
  
  <p>So how to access inner objects in in Thymeleaf EL? (In my case <code>user.department.name</code>)</p>