On Thu, Jun 7, 2012 at 3:43 PM, Sergiu Dumitriu <sergiu(a)xwiki.com> wrote:
On 06/07/2012 09:28 AM, mathieu.canzerini(a)intech.lu
wrote:
Hello everybody,
i need to use Ajax but i can not generate XML from a velocity script page.
Here is a piece of my script :
{{velocity}}
$response.setContentType('application/xml')
#set ($out = $response.getOutputStream())
$out.write("<?xml version='1.0'
encoding='ISO-8859-1'?><test>test</test>")
...
{{/velocity}}
But my responseXML is null.
I suppose that it's not the good way to generate XML from velocity.
Thanks for your help.
M. Canzerini
See this other thread:
http://markmail.org/message/tjrnj6zy2n37blua
Short summary, you should call flush() and close() on the stream after
you're done writing data to it.
You can indeed also use $out.flush() and $out.close() instead of
$xcontext.setFinished(true).
--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne