File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Save a JSP page as Word document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Save a JSP page as Word document" Watch "Save a JSP page as Word document" New topic

Save a JSP page as Word document

Pallavi Roy
Ranch Hand

Joined: Jun 01, 2006
Posts: 37
Hi All,

I have .jsp page with some generated content. In that page, there is a button as "save as word". When the link is clicked , i need the save dialog to appear and prompt the user to save the content in the JSP page as word document.How can i do this in JSP.
Please guide me in this regard.

Thanks & Regards,

Break the ice - SCJP 1.4,<br />Where There's a will- SCWCD 1.4.<br />Back in action - Websphere Certified Portal 6 Application Developer
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Once the page has been sent to the broswer, the fact that it was a JSP is moot.

When the button is clicked, a new request will be sent to the server. In this request, a servlet should be called that takes the same data as was sent to the JSP and format it as an RTF document (which is a lot easier to generate than a native Word document).

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Save a JSP page as Word document
It's not a secret anymore!