jersey上使用jackson如何适配驼峰命名法

版权声明: https://blog.csdn.net/QingShuRuNinDeWan/article/details/82222501

注意需要加上

@XmlElement(name = "user_id", required = true)
@JsonProperty("user_id")
private String userId;

其实XmlElement很关键。 光使用jsonProperty是没有用的, 具体机理未了解,后面有空了补上,以及如何自动。 内容查询自:
https://stackoverflow.com/questions/21995175/umarshall-json-object-with-underscore-and-camelcase-fields-between-jackson-and-j

猜你喜欢

转载自blog.csdn.net/QingShuRuNinDeWan/article/details/82222501
今日推荐