Reputation: 8585
I wonder if can replace the filter CharacterEncodingFilter by the HttpEncodingProperties.
I saw at documentation below ones:
# HTTP encoding (HttpEncodingProperties)
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
Will it have the same effect that applying the filter manually? Another question, if I want to inform Spring Boot to keep the filter (properties) as async. Via filter I can inform it, setAsyncSupported(true).
Tks,
Upvotes: 1
Views: 2938
Reputation: 8585
Spring Boot has many auto configurations per default, and http encoding is just one more using this concept.
Looking into the source code of HttpEncodingAutoConfiguration class, the filter CharacterEncodingFilter is created to encode all requests made to server. If you don't specify any property in application.properties the filter will be created using UTF-8, however if you decide creating this filter manually Spring Boot will use yours.
Upvotes: 1