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
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
jQuery in Action, 3rd edition