java - Spring MVC encode request from Cp1252 to UTF-8 -
there post request controller json encoded in cp1252
. how can encode request body utf-8
? use jackson pojo.
try add filter web.xml:
<filter> <filter-name>characterencodingfilter</filter-name> <filter-class>org.springframework.web.filter.characterencodingfilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> <init-param> <param-name>forceencoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterencodingfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
i had similar problem , solved it.
Comments
Post a Comment