title: Thymeleaf : How to get first element of list without iterating?
body: <p><code>foo.messageData</code> is a list. <code>messageData</code> contains <code>name</code> as a string.</p>
  
  <p>In thymeleaf html template, I want to print the value of <code>name</code> property of the first element of <code>messageData</code>.</p>
  
  <p>Something like <code>foo.messageData[0].name</code>:</p>
  
  <pre><code>&lt;span th:text="foo.messageData[0].name"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;span th:text="foo.messageData.get(0).name"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>is not working.</p>
  
  <p>How to print this data? Is there any particular syntax for this in Thymeleaf?</p>
  
  <p>I am aware that this value can be printed via iterating using <code>th:each</code>; but I do not want these iterations.</p>