Update Content-Type based on encoding in MVC FreeMarkerView

Closes gh-33119
This commit is contained in:
Sam Brannen
2024-06-29 16:20:34 +02:00
parent ce53443cf0
commit b64edb2d2a
12 changed files with 134 additions and 54 deletions

View File

@@ -24,6 +24,8 @@ import freemarker.template.Configuration;
*
* <p>Detected and used by {@link FreeMarkerView}.
*
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.26 or higher.
*
* @author Rossen Stoyanchev
* @since 5.0
*/

View File

@@ -56,7 +56,7 @@ import org.springframework.util.Assert;
* &lt;@spring.bind "person.age"/&gt;
* age is ${spring.status.value}</pre>
*
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.21 or higher.
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.26 or higher.
*
* @author Rossen Stoyanchev
* @since 5.0

View File

@@ -90,7 +90,7 @@ import org.springframework.web.server.ServerWebExchange;
* sets the supported media type to {@code "text/html;charset=UTF-8"} by default.
* Thus, those default values are likely suitable for most applications.
*
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.21 or higher.
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.26 or higher.
*
* @author Rossen Stoyanchev
* @author Sam Brannen
@@ -158,7 +158,7 @@ public class FreeMarkerView extends AbstractUrlBasedView {
* <p>If the encoding is not explicitly set here or in the FreeMarker
* {@code Configuration}, FreeMarker will read template files using the platform
* file encoding (defined by the JVM system property {@code file.encoding})
* or {@code "utf-8"} if the platform file encoding is undefined. Note,
* or UTF-8 if the platform file encoding is undefined. Note,
* however, that {@link FreeMarkerConfigurer} sets the default encoding in the
* FreeMarker {@code Configuration} to "UTF-8".
* <p>It's recommended to specify the encoding in the FreeMarker {@code Configuration}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,8 @@ import org.springframework.web.reactive.result.view.UrlBasedViewResolver;
* <p>The view class for all views generated by this resolver can be specified
* via the "viewClass" property. See {@link UrlBasedViewResolver} for details.
*
* <p>Note: Spring's FreeMarker support requires FreeMarker 2.3.26 or higher.
*
* @author Rossen Stoyanchev
* @since 5.0
*/