Hi!
How can I generate .docx documents and send it to output stream? I'm using 
GAE + GWT + RPC + datastore.

I've tried using Apache POI but always received IOException:

> XWPFDocument document = new XWPFDocument();  
> XWPFParagraph tmpParagraph = document.createParagraph();  
> XWPFRun tmpRun = tmpParagraph.createRun();  
> tmpRun.setText("Hello World!");  
> tmpRun.setFontSize(18);
> getThreadLocalResponse().setHeader("Content-Disposition", 
> "attachment;filename=test.docx");
> getThreadLocalResponse().setContentType("application/vnd.ms-word");
> getThreadLocalResponse().setHeader("Cache-Control", "max-age=0");
> try {
> ServletOutputStream out = getThreadLocalResponse().getOutputStream();
> document.write(out);
> out.flush(); 

  out.close(); 

} catch (IOException e) {
> e.printStackTrace();
> }

Caused by: java.io.IOException: Closed

Please, give me some advices...
Regards!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/R8apb6Vp5T8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to