Set output_encoding in FreeMarkerView implementations

According to the official FreeMarker documentation, Spring's
FreeMarkerView implementations should be configuring the
output_encoding for template rendering.

To address that, this commit modifies the FreeMarkerView
implementations in Web MVC and WebFlux to explicitly set the
output_encoding for template rendering.

See https://freemarker.apache.org/docs/pgui_misc_charset.html#autoid_53
See gh-33071
Closes gh-33106
This commit is contained in:
Sam Brannen
2024-06-27 10:03:26 +02:00
parent 95887c81b9
commit 8b95697c8d
7 changed files with 71 additions and 27 deletions

View File

@@ -1 +1,6 @@
<html><body>${hello}, Java Café</body></html>
<html>
<body>
<h1>${hello}, Java Café</h1>
<p>output_encoding: ${.output_encoding}</p>
</body>
</html>