spring版本:4.2.5.RELEASE 查看“org.springframework.http.converter.StringHttpMessageConverter”源码,中有一段说明: By ;&#;&#;}), and writes with a {@code Content-Type} of {@code text/plain}. This can be overridden by setting the {@link #setSupportedMediaTypes sup…
1.springMVC在使用@ResponseBody注解返回字符串为什么出现乱码呢?(这里以spring4.3.1为例) 原因分析:原因在返回字符串时StringHttpMessageConverter默认编码为:ISO8859-1,如下: public class StringHttpMessageConverter extends AbstractHttpMessageConverter<String> { public static final Charset DEFAULT_CHAR…