简体   繁体   中英

Playframework RenderXml - exclude some fields in response?

In Playframework (1.2.4) I am looking for a function similar to GSON's @Expose annotation, where some fields may be excluded in the response (RenderXml). The XML response is a requirement else I would use the JSON.

Totally forgot I had asked this question. Playframework 1 uses the XML library XStream and it has annotations similar to GSON's @Expose annotation, but it is inverted. You have to exclude what you do not want to be shown in the response by using the annotation @XStreamOmitField .

A good tutorial can be found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM