1.thymeleaf
The spring boot recommended template engine is thymeleaf. Spring boot automatic configuration has been configured by default Themleaf, as long as the import themleaf starter is OK.
< Dependency > < groupId >org.springframework.boot</groupId> < Artifactid>spring-boot-starter-thymeleaf</artifactid>
</ Dependency >
In order to use the advanced features of themleaf, we recommend switching the Themleaf version to more than 3.0
< Properties > < thymeleaf.version >3.0.9.RELEASE</thymeleaf.version> < Thymeleaf-layout-dialect.version>2.1.1</ Thymeleaf-layout-dialect.version>
</ Properties >
Themleaf can replace the corresponding label of native HTML with all the tags that begin with th: The main syntax has the following points:
(1) ${.} takes the value of the variable, similar to the OGNL
(2) #{...} : Get International content
(3) @{...} : Define URLs
(4) ~{...} : Fragment-Reference expression
(5) *{...} : Select variable expression, function and ${} similar
Themleaf also supports string manipulation, mathematical calculations, comparisons, condition judgments, and a number of tool methods, such as methods for date formatting ${#dates. Format (date)}
Spring boot-9. Support for SPRINGMVC