【发布时间】:2017-07-03 08:27:27
【问题描述】:
这是我的简化对象结构:
@xmlRootelement
ArticleList implements Serializable{
//ArrayList of articles
}
Article implements Serializable
{
User user;
//ArrayList of bids
}
User implements Serializable
{
//Properties
}
Bid implements Serializable
{
//Properties
}
函数标题:
@GET
@Path("/article-search")
@Produces( MediaType.APPLICATION_JSON )
public ArticleList articleSearch() {
//Function code here
}
我在 jersey 函数中返回 ArticleList。在答案中,我检查是否存在带有元素的对象出价。
问题是在响应中找不到对象Bids的任何元素
响应示例:
{
"articles":[
{
//Some Props. Here
"user":{
//Some Props. Here
}
//Here list of bids is missing. It is verified that the list contains elements
}
]
}
【问题讨论】:
标签: java json serialization jersey-2.0