Hi,
Can you try to change your Json like this:
"userAgentDetailList":{
"userAgentDetail":[
{...}, {...},{...}
]
}
--
Best regards.
Yaroslav
Jersey version: 2.13JSON support: moxjersey-media-moxy yJSON data:{"agentName": "myAgent", "gameId": 2, "id": 1, "loginName": "admin", "userAgentDetailList": [
{
"agentId": "agent_1" }, {
"agentId": "agent_2" }, {
"agentId": "agent_3" } ] }
UserAgent.java
@XmlRootElementpublic class UserAgent implements Serializable {private Integer id;private String loginName;private Integer gameId;private String agentName;List<UserAgentDetail> userAgentDetailList;//setter,getter}UserAgentDetail.java
@XmlRootElementpublic class UserAgentDetail implements Serializable {private Integer id;private Integer userAgentId;private String agentId;...//setter,getter}UserAgentResource.java
@PUT@Produces("application/json;charset=UTF-8")@Consumes("application/json")public String putUserAgent(UserAgent userAgent) {logger.entry();//do something...logger.exit();return "";}I found the useAgent is auto populated correctly,but the nested List<UserAgentDetail> userAgentDetailList, could not be populated correctly, actually, the List is created, but the elements in the List are not created properly.so, how to process the nested object?thanks.