API / Apache Velocity Interview questions
What is the difference in templating philosophy between Apache Velocity and Thymeleaf?
Velocity templates are only valid once rendered; a raw .vm file full of $ references and #if blocks won't display sensibly if you just open it in a browser or hand it to a designer as static HTML.
Thymeleaf takes the opposite approach, called "natural templating": its directives live inside standard HTML attributes (th:text, th:if, th:each), so the same file is valid, viewable HTML even before Velocity-style processing, a browser or a designer's tool just ignores the unrecognized th:* attributes and shows reasonable placeholder content.
Thymeleaf is also the templating engine most closely integrated with modern Spring, with first-class Spring Boot auto-configuration, while Spring dropped its built-in Velocity integration back in Spring Framework 5 (Spring 4.3 had already deprecated it), making Velocity a less common default choice for new Spring-based projects today.
More Related questions...