<mvc:annotation-driven>
<mvc:message-converters register-defaults="true"> <bean class="org.springframework.http.converter.StringHttpMessageConverter"> <constructor-arg value="UTF-8" /> <!-- 使用@ResponseBody后会产生很大的响应头(Accept-Charset会达到4K+) --> <property name="writeAcceptCharset" value="false" /> </bean> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" p:supportedMediaTypes="text/html;charset=UTF-8" /> <!-- <bean class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes" value="text/html;charset=UTF-8"/> </bean> --> </mvc:message-converters> </mvc:annotation-driven>