解决:Could not write JSON: No serializer found for class *** and no properties错误

场景:使用RestController或者Controller注解将查询的实体装换成json字符串时报错。java 缘由:须要装换的对应实体类的属性缺乏:getter和setter方法,致使将实体类装换的json格式类没法读取对应的属性从而报错。json 解决方法:在须要装换的是实体类中给属性加上getter和setter方法(或者使用:lombok插件给实体类加上:Getter和Setter注解
相关文章
相关标签/搜索