To use the #temporals
object, you need to include the thymeleaf-extras-java8time
project in the project. Here is the GitHub page of the module for additional functions.
This module adds a #temporals
object, similar to the #dates
or #calendars
tags in a standard dialog box, allowing you to format and create temporary objects from Timeleaf templates.
In version 1.4.1 of Spring Boot, you only need to enable the extras module, and autoconfiguration will configure it for you. Make sure you provide the correct version, depending on your version of Thymeleaf:
- Version 3.0.0.RELEASE - for Thymeleaf 3.0 (Thymeleaf 3.0.0 + required)
- Version 2.1.0.RELEASE - for Thymeleaf 2.1 (Thymeleaf 2.1.3 + required)
I have the same Spring boot and thymeleaf versions as you, and I got the same error only because I am providing an unacceptable version of additional functions (3.0.0). Switching to a lower version fixed the problem (in my case in the maven pom file):
<dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-java8time</artifactId> <version>2.1.0.RELEASE</version> </dependency>
source share