Save Word Docs To client Browser

Is there a way in Java to save/send the created word document to a client browser? I see there is a way in .NET

Hi John,


Thanks for your inquiry.

You need to implement an HTTPServlet
before you can send the document to the browser. You can find a demo example with full code here. Please see “sendToBrowser” function mentioned inside “Demo.java” tab. Using the servlet you can send the document to a browser like in the example code below which sends a .pdf file to the browser.

Using the servlet you can send the document to a browser like in the example code below which sends a .doc file to the browser.
response.setContentType(“application/msword”);
doc.save(response.getOutputStream(), SaveFormat.FORMAT_DOCUMENT);
I hope, this will help.