Reputation: 134
In thymeleaf 2.1.4, when evaluating null String values with
<p th:inline="text">[[${bean.myNullvar}]]</p>
The outlined html is
<p>null</p>
When I use it with th:text it works correctly:
<p th:text="${myNullvar}"></p>
is outlined as:
<p></p>
¿Is there any way to render String null values as empty ones with inlining? ¿How is it going to work in Thyeleaf 3, where inline is active by default?
Thanks in advance
Upvotes: 2
Views: 2181
Reputation: 3582
Thymeleaf has some string utility method you can try
Here is the null safe toString.
${#strings.toString(obj)}
Upvotes: 4