Customize Thymeleaf default template resolver order

Currently, the default TemplateResolver had no specific order. Thymeleaf
handles that with a "always first" strategy (that can be confusing if
several TemplateResolver have a "null" order.

While it is a fine default (and changing it could lead to weird side
effects), it has to be changed as soon as another TemplateResolver bean
is defined in the project.

The `spring.thymeleaf.template-resolver-order` property has been added to
control  the order of the default TemplateResolver.

Closes gh-3575
This commit is contained in:
Stephane Nicoll
2015-07-28 14:28:31 +02:00
parent 65c6492b6f
commit 96fc107ca1
4 changed files with 33 additions and 0 deletions

View File

@@ -194,6 +194,7 @@ content into your application; rather pick only the properties that you need.
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html # ;charset=<encoding> is added
spring.thymeleaf.cache=true # set to false for hot refresh
spring.thymeleaf.template-resolver-order= # order of the template resolver in the chain
# FREEMARKER ({sc-spring-boot-autoconfigure}/freemarker/FreeMarkerAutoConfiguration.{sc-ext}[FreeMarkerAutoConfiguration])
spring.freemarker.allow-request-override=false