Upgrade to Thymeleaf 3 and drop support for Thymleaf 2

This commit raises the minimum supported version of Thymeleaf to
3.0.x. It also upgrades Spring Social to a version that is compatible
with Thymeleaf 3.

Closes gh-7450
Closes gh-6258
See gh-7885
This commit is contained in:
Andy Wilkinson
2017-01-25 13:53:21 +00:00
parent 9c77708fcb
commit 9bba73a1a9
41 changed files with 171 additions and 11684 deletions

View File

@@ -424,7 +424,7 @@ content into your application; rather pick only the properties that you need.
spring.thymeleaf.enabled=true # Enable MVC Thymeleaf view resolution.
spring.thymeleaf.encoding=UTF-8 # Template encoding.
spring.thymeleaf.excluded-view-names= # Comma-separated list of view names that should be excluded from resolution.
spring.thymeleaf.mode=HTML5 # Template mode to be applied to templates. See also StandardTemplateModeHandlers.
spring.thymeleaf.mode=HTML # Template mode to be applied to templates. See also org.thymeleaf.templatemode.TemplateMode.
spring.thymeleaf.prefix=classpath:/templates/ # Prefix that gets prepended to view names when building a URL.
spring.thymeleaf.suffix=.html # Suffix that gets appended to view names when building a URL.
spring.thymeleaf.template-resolver-order= # Order of the template resolver in the chain.

View File

@@ -216,7 +216,7 @@ number empty:
----
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.thymeleaf:thymeleaf-spring4")
compile("org.thymeleaf:thymeleaf-spring5")
compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect")
}
----

View File

@@ -1248,42 +1248,6 @@ Check out {sc-spring-boot-autoconfigure}/web/WebMvcAutoConfiguration.{sc-ext}[`W
[[howto-use-thymeleaf-3]]
=== Use Thymeleaf 3
By default, `spring-boot-starter-thymeleaf` uses Thymeleaf 2.1. If you are using the
`spring-boot-starter-parent`, you can use Thymeleaf 3 by overriding the
`thymeleaf.version` and `thymeleaf-layout-dialect.version` properties, for example:
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
----
<properties>
<thymeleaf.version>3.0.2.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version>
</properties>
----
NOTE: if you are managing dependencies yourself, look at `spring-boot-dependencies` for
the list of artifacts that are related to those two versions.
To avoid a warning message about the HTML 5 template mode being deprecated and the HTML
template mode being used instead, you may also want to explicitly configure
`spring.thymeleaf.mode` to be `HTML`, for example:
[source,properties,indent=0,subs="verbatim,quotes,attributes"]
----
spring.thymeleaf.mode: HTML
----
Please refer to the
{github-code}/spring-boot-samples/spring-boot-sample-web-thymeleaf3[Thymeleaf 3 sample] to
see this in action.
If you are using any of the other auto-configured Thymeleaf Extras (Spring Security,
Data Attribute, or Java 8 Time) you should also override each of their versions to one
that is compatible with Thymeleaf 3.0.
[[howto-http-clients]]
== HTTP clients