Thymeleaf Tips[Template Engine for Java]


Thymeleaf is a server-side template engine in Java.

Thymeleaf includes the following features:

  • Processing logic specified via processors that apply to attributes in our tags.
  • Expression objects which can be used in Themeleaf Standard Expression like #arrays, #dates in order to perform the specialized operations.

In this post, I would like to share some tips to use it thoughtfully.

🐮 Check empty or not

How to check empty or not in array/list is as follows:

<div th:if="${not #lists.isEmpty(tblUserList)}">
<! --content-- >
</div>

🍄 Special Thanks

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!