server.servlet.encoding.force, server.servlet.encoding.force-request, server.servlet.encoding.force-response
HttpEncodingAutoConfiguration applies them to auto-configured CharacterEncodingFilter
- affects any servlet web app, not just an embedded web server
server.servlet.encoding.charset
HttpMessageConvertersAutoConfiguration applies it to auto-configured StringHttpMessageConverter
- affects reading or writing of
Strings during blocking HTTP exchanges (Spring MVC, RestTemplate, RestClient)
HttpEncodingAutoConfiguration applies it to auto-configured CharacterEncodingFilter
- affects any servlet web app, not just an embedded web server
server.servlet.encoding.mapping
HttpEncodingAutoConfiguration applies it to ConfigurableServletWebServerFactory
- affects servlet web apps using an embedded web server
Prior to #18827, properties were all named spring.http.encoding.*..
I think we need to move to somewhere between the two extremes, perhaps the following:
spring.servlet.encoding.charset
spring.servlet.encoding.force
spring.servlet.encoding.force-request
spring.servlet.encoding.force-response
spring.http.converters.string-encoding-charset
server.servlet.encoding.mapping
I'm unsure about both spring.servlet.encoding.charset and spring.http.converters.string-encoding-charset. The former should be applied to the auto-configured CharacterEncodingFilter that applies to all servlet web apps. The latter would be applied to the auto-configured StringHttpMessageConverter that applies to any blocking HTTP exchange using Spring MVC, RestTemplate, or RestClient. Having two properties that will have the same value the vast majority of the time is not ideal.
server.servlet.encoding.force,server.servlet.encoding.force-request,server.servlet.encoding.force-responseHttpEncodingAutoConfigurationapplies them to auto-configuredCharacterEncodingFilterserver.servlet.encoding.charsetHttpMessageConvertersAutoConfigurationapplies it to auto-configuredStringHttpMessageConverterStrings during blocking HTTP exchanges (Spring MVC,RestTemplate,RestClient)HttpEncodingAutoConfigurationapplies it to auto-configuredCharacterEncodingFilterserver.servlet.encoding.mappingHttpEncodingAutoConfigurationapplies it toConfigurableServletWebServerFactoryPrior to #18827, properties were all named
spring.http.encoding.*..I think we need to move to somewhere between the two extremes, perhaps the following:
I'm unsure about both
spring.servlet.encoding.charsetandspring.http.converters.string-encoding-charset. The former should be applied to the auto-configuredCharacterEncodingFilterthat applies to all servlet web apps. The latter would be applied to the auto-configuredStringHttpMessageConverterthat applies to any blocking HTTP exchange using Spring MVC, RestTemplate, or RestClient. Having two properties that will have the same value the vast majority of the time is not ideal.