Clientside Javascript --> Serverside Java --> user is served a .doc

Posted by ignorantslut on Stack Overflow See other posts from Stack Overflow or by ignorantslut
Published on 2009-06-17T11:34:21Z Indexed on 2010/05/28 14:12 UTC
Read the original article Hit count: 191

I am helping someone out with a javascript-based web app (even though I know next to nothing about web development) and we are unsure about the best way to implement a feature we'd like to have.

Basically, the user will be using our tool to view all kinds of boring data in tables, columns, etc. via javascript. We want to implement a feature where the user can click a button or link that then allows the user to download the displayed data in a .doc file.

Our basic idea so far is something like:

  • call a Java function on the server with the desired data passed in as a String when the link is clicked
  • generate the .doc file on the server
  • automatically "open" a link to the file in the client's browser to initiate the download

Is this possible? If so, is it feasible? Or, can you recommend a better solution?

edit: the data does not reside on the server; rather, it is queried from a SQL database

© Stack Overflow or respective owner

Related posts about java

Related posts about JavaScript