I'd like to be able to generate pure JSON from a wiki page, to use in other 
pages via AJAX. To that end I created a page with the following content:
{{velocity wiki="false"}}
$response.setContentType('application/json')
{
"greeting" : "Hello",
"location": "World"
}
{{/velocity}}

Calling this via /xwiki/bin/get/Sandbox/JsonTest I get the following code:

<p><br/>&#123;<br/>"greeting" : "Hello",<br/>"location": "World"<br/>}</p>

I get the same via /xwiki/bin/view/AlertDB/JsonTest?xpage=plain.

If I remove the $response.setContentType('application/json')
https://dev.alertnessdb.net/xwiki/bin/view/AlertDB/JsonTest?xpage=plain


_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to