Spring Boot using Thymeleaf 3

Source: Internet
Author: User
74.9 using Thymeleaf 3

By default, Spring-boot-starter-thymeleaf uses Thymeleaf 2.1. If you are using Spring-boot-starter-parent, you can use Thymeleaf 3 by overriding the Thymeleaf.version and Thymeleaf-layout-dialect.version properties, for example:

<properties> 
    <thymeleaf.version> 3.0.2.RELEASE </thymeleaf.version> 
    < thymeleaf-layout-dialect.version>
 2.1.1 </thymeleaf-layout-dialect.version> </properties>

If you are managing dependencies yourself, check out the spring-boot-dependencies list of artifacts related to these two versions.

In order to avoid the deprecated HTML 5 template pattern and the HTML template pattern warning information is used instead, you may also need to explicitly configure Spring.thymeleaf.mode for HTML, for example:

Spring.thymeleaf.mode:HTML

See the Thymeleaf 3 sample to see this action.

If you are using any other auto-configured Thymeleaf Extras (Spring Security, data properties, or Java 8 time), you should also overwrite each version with a version that is compatible with Thymeleaf 3.0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.