[xwiki-users] Return image in http response

2009-06-14 Thread jerem
Hi all, I have some groovy page generating an image (BufferedImage), and I would like it to be returned and displayed in browser. I first tried to save this image as a png file with ImageIO, and it works pretty well and image can be displayed. If then I try to return it in http response, it

Re: [xwiki-users] Return image in http response

2009-06-14 Thread jerem
I tried to attach the image file back into the page, but if I call $xwiki.getDocument(...).addAttachment(...) it fails, as well as if I call xwiki.getDocument(...).addAttachment(...), saying it does not know the property xwiki. By the way my groovy scripts in syntax 1.0, migrated to 2.0, complain