一、示例代码: 访问 localhost:8080/jsonTest —— 返回 json 格式的数据 @Controller
public class ResponseTestController { @ResponseBody // 标注 —— 自动返回json数据 @GetMapping("/jsonTest") public Person testPerson(){ Person pers...
在Springboot中默认的JSON解析框架是jackson 定制或使用fastjson需要替换默认的json转换器的方法。 一、(1)实现WebMvcConfigurer (2)覆盖方法configureMessageConverters @Configuration
public class WebMVCConfig implements WebMvcConfi...