json simply giving mapperException
Conflicting setter definitions for property
public void setJanuary(String january) {
try {
setJanuary(Float.parseFloat(january));
} catch (NumberFormatException exception) {
setJanuary(0);
}
}public void setJanuary(float january) {
this.january = january;
}
通过使用注释@JsonSetter解决了问题我们从Json使用的setter
@JsonIgnore
排除的setter方法使用@JsonIgnore
注释。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.