标签:json oid tpm cat response method pos ext turn
一、方式一
在单个REST接口上设置
@ResponseBody @RequestMapping(value = "sys/getTree1",method = RequestMethod.POST,produces="application/json;charset=UTF-8") public String getTree1(){ return "success"; }
二、方式二
全局配置(推荐)
@Configuration public class WebMvcConfig extends WebMvcConfigurationSupport { @Override protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.add(responseBodyConverter()); super.configureMessageConverters(converters); } @Bean public HttpMessageConverter responseBodyConverter() { StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8")); return converter; } }
标签:json oid tpm cat response method pos ext turn
原文地址:https://www.cnblogs.com/yoyotl/p/11617727.html