我有一个Json String可从WebView请求中获取
为了保持一致性,我想使用RestTemplate将httpstring反序列化为对象
是否可以?
RestTemnplate将始终发送请求与您保持一致的最佳方法是使用ObjectMapper示例代码:
public void convertJSONToProduct() throws Exception {
ObjectMapper m = new ObjectMapper();
Product product = m.readValue(jsonString, Product.class);
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句