使用ObjectMapper对象的writeValue方法
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(response.getWriter(),msg);
使用ObjectMapper对象的writeValue方法
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(response.getWriter(),msg);
转载于:https://www.cnblogs.com/meng-ma-blogs/p/7001623.html