Bạn có chắc chắn muốn xóa bài viết này không ?
Bạn có chắc chắn muốn xóa bình luận này không ?
Integrate Spring RestAPIs with @JsonView
https://grokonez.com/java-integration/integrate-spring-restapis-jsonview
Integrate Spring RestAPIs with @JsonView
In the previous post, We had learned how to use @JsonView
to serialize/de-serialize Java objects. Now we go to next step, JavaSampleApproach shows you how to integrate Spring RestAPIs with @JsonView
to customize views and resolve infinity loop problem.
Related posts:
- How to use @JsonView to serialize/de-serialize and customize JSON format from Java Object.
- How to resolve Json Infinite Recursion problems when working with Jackson
I. Technologies
– Java: 1.8
– Maven: 3.3.9
– Spring Tool Suite: Version 3.8.4.RELEASE
– Spring Boot: 1.5.4.RELEASE
– Jackson library
– Json library
II. Integrate Spring RestAPIs with @JsonView
For the tutorial, We create 2 models Company & Product which have one-to-many relationship.
- Company
public class Company {
private int id;
private String name;
private List products;
...
– Product
https://grokonez.com/java-integration/integrate-spring-restapis-jsonview
Integrate Spring RestAPIs with @JsonView




