Search code examples
springspring-bootthymeleaf

What is thymeleaf? And what are the advantages of using thymeleaf?


Why do we need thymeleaf. How it is helpful for the developers? I have seen an example where user name is fetched using a simple code by the author in w3schools.com like below.

**<form:inputText name="userName" value="${user.name}" />**

Also, the same author from w3schools try to teach how we can fetch the user name using thymeleaf as below.

**<input type="text" name="userName" value="James Carrot" th:value="${user.name}" />**

But my question is why do we need thymeleaf? It simply increasing code size. Someone please help me in understanding this.


Solution

  • Thymeleafe is a template engine like JSP. It makes developer work easy by designing application templates effectively. It composes many features which make a developer's life easy.

    For more information see "Thymeleaf".

    Also, from Stackoverflow "What kind of a solution is thymeleaf?".

    Also, you will find many questions for the beginner's level.

    Do not hesitate to ask questions. Keep digging.