返回用@responsebody自动处理json,默认使用的是Jackson解析。Jackson在解析返回的json字符串时始首字母是小写

 

public class Tech {
    
    private String CTOLevel;
    @PostMapping("/get")
    Tech get() {
        return XX;
    }

前端在接收到数据后,字段CTOLevel会变成ctolevel

 

解决办法:

增加@JsonProperty注解

public class Tech {
    @JsonProperty("CTOLevel")
    private String CTOLevel;

 

相关文章:

  • 2021-08-16
  • 2021-12-27
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2021-12-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案