1 reply
by jay eckles
If you just want to provide a link to the Word document, I would use a servlet that connects to the database and retrieves the document. The servlet then sets the content type to something like application/ms-word and then writes the bytes of the document out to the response. To use such a servlet, you'd provide a link like this:
budget.doc
To get examples of setting the content type and writing raw bytes to the response, look for a servlet thatreturns an image rather than HTML. This is more common than a servlet that returns a Word document, but the concept is exactly the same...all you'll have to do is change the data source and the content type.
If you want to display the contents of the word document in a browser window or frame, that might be a bit more difficult, and you'd start getting into client software specific coding.
Good luck.
Jay Eckles
www.jayeckles.com
PS - I actually have servlet code that I've already written that returns a Word document in the manner I'm describing. If you're interested in learning more about it, email me at j.eckles@computer.org.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending