[英]How to render special XML/JSON Flavours with Playframework
According to James Wards Play Tutorial it's very easy to get a JSON out of your model. 根据James Wards Play Tutorial ,从模型中获取JSON非常容易。 Also with XML this should be quite simple.
使用XML也应该非常简单。
But most of the time, I have the requirement to build not just an plain XML or JSON Endpoint, but furthermore to deliver special flavours of those. 但大多数时候,我不仅需要构建纯XML或JSON端点,还要提供特殊的那些。 In my case this is GeoJSON or TopoJSON .
在我的例子中,这是GeoJSON或TopoJSON 。 But also in XML, it could be a simple RSS or ATOM Feed you have to deliver out of your model.
但是在XML中,它可能是一个简单的RSS或ATOM Feed,你必须从模型中提供。 Also building a XML fitting to a very nasty XSD schema is still a case sometimes.
同时,构建适合非常讨厌的XSD架构的XML也是一种情况。
What options do you have in play to perform this, or which one of the following would you recommend?: 您有什么选择来执行此操作,或者您建议使用以下哪一项?:
toJson(tasks)
? toJson(tasks)
的JSON响应的方法?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.