File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes open word from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "open word from a servlet" Watch "open word from a servlet" New topic

open word from a servlet

Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
This is the scenario:
- the user submits a form and activate a servlet
- the servlet writes a file ( a word document) to disk
- now I want the servlet to open the word document....
How do I do that ?
- I've tried with a forward request, but that only displays the content in the browser, I want to open the document in word.
thanks in advance
Sandeep Jain
Ranch Hand

Joined: Oct 25, 2000
Posts: 124
Hi ,
Check out if this is what u wanted.
import javax.servlet.*;
import javax.servlet.http.*;
public class postRecieved extends HttpServlet
public void service(HttpServletRequest req,HttpServletResponse res)throws IOException,ServletException
PrintWriter pw=res.getWriter();
pw.println("Sandy how are u doing ");

Try and Try Till u succeed
Sandeep Jain

Try and Try Till u succeed<br /> <br />Sandeep Jain
I agree. Here's the link:
subject: open word from a servlet
Similar Threads
Is it possible to open a word document in client side by javascript?
Can java send command to keyboard???
"mailmerge" to WORD doc and automatically print?
How to create MSWORD doc and open the doc in jsp?
jsp page contents in the word document