How to configure CharacterEncodingFilter in SpringBoot?

后端 未结 4 1210
暗喜
暗喜 2020-12-08 07:02

I encountered some encoding problems in learning Spring Boot; I want to add a CharacterEncodingFilter like Spring 3.x. just like this:


    <         


        
4条回答
  •  执念已碎
    2020-12-08 08:02

    I think there is no need to explicity write the following properties in application.properties file:

    spring.http.encoding.charset=UTF-8

    spring.http.encoding.enabled=true

    spring.http.encoding.force=true

    Instead if you go to pom.xml in your application and if you have the following, then spring will do the needful.

提交回复
热议问题