开发者

JAXB / Jersey - Feed doesn't show my nested list - Any idea?

it's really frustrating and I've been fighting with this issue for almost 5 hours now... :(

I'd expect JAXB/Jersey to embed my list of downloads in the Project's Json Feed... but unfortunately it's开发者_高级运维 completely missing.

Here's the code snippet:

Project.java
...
@XmlElement
    public final List<Download> getDownloads() {
        return this.downloads;
    }
...

I can fetch the Download object itself without any problems...

{"contentType":"application/zip","fileName":"source_something.zip","key":"17","title":"Some new title"}

When I use a list of Strings - everything works perfectly fine!

@XmlElement
    public final List<String> getTechnologies() {
        return this.technologies;
    }

Output of project.json (see nested technologies list):

{"key":"16","date":"1999-01-13T02:23:31.712Z","description":"someDesc","teaser":"This is just a teaser!","technologies":["someTec1","someTec2","bar","foo"],"title":"My First Project","type":"MOBILE"}

My Download class looks pretty much like this (and as I've mentioned already - this works pretty fine when used directly):

@XmlRootElement
public class Download extends BaseDownloadBean {
...

@XmlElement
    public final String getFileName() {
        return this.filename;
    }
}

Do you guys have any idea what the problem might be?


Setting the Download object to be a JAXB annotated class should solve the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜