I see that JSP pages have .jsp
/.jspf
/.jspx
suffixes (from JavaServer Pages™ Specification Version2.2), Velocity templates uses .vm
suffix, FreeMarker uses .ftl
suffix.
What is recommended file suffix for Thymeleaf templates according to official body/docs/IDE expectation?
.html
suffix can mislead with pure HTML 5 files. For that reason I think about putting all Thymleaf templates into thy/
hierarchy and pure HTML files keep inside html/
directory.
Thymeleaf template files are located in the custom src/main/resources/mytemplates directory. The default template directory is src/main/resources/templates . This is the Maven build file.
Thymeleaf is a modern server-side Java template engine for both web and standalone environments, capable of processing HTML, XML, JavaScript, CSS and even plain text. The main goal of Thymeleaf is to provide an elegant and highly-maintainable way of creating templates.
Last modified: 13 June 2022. Required plugin: Thymeleaf (bundled) Thymeleaf is a server-side Java template engine for both web and standalone environments. Its main goal is to bring natural templates to your development workflow — HTML that can be correctly displayed in browsers and also work as static prototypes.
Thymeleaf uses natural templates. A HTML5 Thymeleaf template can (and should) be a valid HTML document. Therefore these templates do not need its own extension, opposite to for example Velocity and Freemarker.
To distinguish Thymeleaf templates from other HTML files you could put them in a directory called templates
, this is what the official Spring integration tutorial uses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With