From efaebb13518b942c02c22cfa7f0c8a525d9863e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 2 Aug 2024 15:03:25 +0200 Subject: [PATCH] Document unsupported Freemarker properties with WebFlux This commit updates the configuration metadata and the reference guide to mention that certain FreeMarker features are not available with WebFlux. This stems mostly from the fact that the WebFlux integration is not based on a AbstractTemplateView. Closes gh-11199 --- ...itional-spring-configuration-metadata.json | 28 +++++++++++++++++++ .../modules/how-to/pages/hotswapping.adoc | 2 ++ .../modules/reference/pages/web/reactive.adoc | 3 ++ 3 files changed, 33 insertions(+) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 4046881cfeaf..8683a4ce0539 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1444,6 +1444,34 @@ "reason": "Removed in the open source release of Flyway 7.12." } }, + { + "name": "spring.freemarker.allow-request-override", + "description": "Whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.allow-session-override", + "description": "Whether HttpSession attributes are allowed to override (hide) controller generated model attributes of the same name. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.cache", + "description": "Whether to enable template caching. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.content-type", + "description": "Content-Type value. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.expose-request-attributes", + "description": "Whether all request attributes should be added to the model prior to merging with the template. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.expose-session-attributes", + "description": "Whether all HttpSession attributes should be added to the model prior to merging with the template. Only supported with Spring MVC." + }, + { + "name": "spring.freemarker.expose-spring-macro-helpers", + "description": "Whether to expose a RequestContext for use by Spring's macro library, under the name \"springMacroRequestContext\". Only supported with Spring MVC." + }, { "name": "spring.freemarker.prefix", "defaultValue": "" diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/hotswapping.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/hotswapping.adoc index 2d786c069353..eeb5c14c5faf 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/hotswapping.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/hotswapping.adoc @@ -47,6 +47,8 @@ See {code-spring-boot-autoconfigure-src}/thymeleaf/ThymeleafAutoConfiguration.ja If you use FreeMarker, set `spring.freemarker.cache` to `false`. See {code-spring-boot-autoconfigure-src}/freemarker/FreeMarkerAutoConfiguration.java[`FreeMarkerAutoConfiguration`] for other FreeMarker customization options. +NOTE: Template caching for FreeMarker is not supported with WebFlux. + [[howto.hotswapping.reload-templates.groovy]] diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/web/reactive.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/web/reactive.adoc index d198fdc1e75a..d5a003c8f18f 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/web/reactive.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/web/reactive.adoc @@ -165,6 +165,9 @@ Spring Boot includes auto-configuration support for the following templating eng * https://www.thymeleaf.org[Thymeleaf] * https://mustache.github.io/[Mustache] +NOTE: Not all FreeMarker features are supported with WebFlux. +For more details, check the description of each property. + When you use one of these templating engines with the default configuration, your templates are picked up automatically from `src/main/resources/templates`.