Search code examples
springthymeleaftemplate-engine

template engines vs static resources


In static resources I can have html files with their css and javascript files so i can have a fully dynamic site.

what are the benefits of using over template engines over static resources(like thymeleaf)?


Solution

  • Although Thymeleaf templates can be static resources

    HTML templates written in Thymeleaf still look and work like HTML

    Template engines can display dynamic content in semmingly static resources.

    See detailed example on how to display name using thymeleaf and Spring

      <p th:text="'Hello, ' + ${name} + '!'" />