这是我的简化对象结构:
@xmlRootelement
ArticleList implements Serializable{
//ArrayList of articles
}
Article implements Serializable
{
User user;
//ArrayList of bids
}
User implements Serializable
{
//Properties
}
Bid implements Serializable
{
//Properties
}
Funcion标题:
@GET
@Path("/article-search")
@Produces( MediaType.APPLICATION_JSON )
public ArticleList articleSearch() {
//Function code here
}
我在泽西岛功能中返回ArticleList。在答案中,我检查对象是否存在元素。
问题在于,在响应中找不到对象的任何元素Bids
回应的例子:
{
"articles":[
{
//Some Props. Here
"user":{
//Some Props. Here
}
//Here list of bids is missing. It is verified that the list contains elements
}
]
}
答案 0 :(得分:0)
我需要在对象文章
中添加出价数组列表的geters和setter