json - Spring incoming request mapping -


model classes:

public class usermodel {     public int id;     public string name;     public educationmodel education;      public usermodel(int id, string name, educationmodel education) {         this.id = id;         this.name = name;         this.education = education;     }     public usermodel() {} }  public class educationmodel {     public string degree;     public string institution;      public educationmodel(string degree, string institution) {         this.degree = degree;         this.institution = institution;     }     public educationmodel() {} } 

usermodel uses educationmodel.

i want if pass json of usermodel additional educationmodel object in it, parse , map json these models.

the problem spring reason not constructor in educationmodel , returns null every time. if remove constructor works. need constructor other methods. can see usermodel uses custom constructor maps correctly. when comes educationmodel returns null time.

so, there way fix without losing constructor?


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -