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