If you just want to send the Word document to Word on the client then the
simplest way is to redirect to the .doc file. You could also try setting
the MIME type of the response to "application/msword" and sending the
document as a stream of data.
If, on the other hand, you want to extract data from the Word document on
the server, you will have to find a way to use the Word COM or ActiveX
interface from Java. I think it's supposed to be possible with M$ VJ++.
This is all theoretical - I've never done it myself.
Chris Walker
Brainbench MVP for ASP
http://www.brainbench.com
> -----Original Message-----
> From: Thompson Willard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> I don't think you have to transfer data from word document
> (that resides on
> the server or back end) to word document (for the client) but
> you might, I'm
> not completely sure. I'm sure JSP provides a way to grab the
> file instead,
> perhaps.
>
> ....What I was working on earlier was generating data (not
> from another
> document) and present it in word in the browser for the
> client. What you're
> trying to do I believe is different.
>
> -----Original Message-----
> From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 6:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> But is it possible to read a .doc file
> bcoz I tried to read the file thro a BufferedReader
> and it reads the file in chars which in effect gets the wrong data
> So when the document opens up it has some illegible characters
> I tried the same with a txt file and it was able to read the
> txt perfectly
>
> The solution could be to read the file in terms of bytes and
> output the same
> to
> the client so that the file gets sent to the Word Application
> uninterpreted
> by Java
>
> My Servlet is as
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> public class CVUpload extends HttpServlet
> {
> public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> String str="";
> res.setContentType("application/vnd.ms-excel");
> //PrintWriter out=res.getWriter();
> BufferedReader in= new BufferedReader(new
> FileReader("c:/Test.txt"));
>
> while((str=in.readLine())!=null)
> {
> out.print(str);
>
> }
>
> }
> }
>
> TIA
> Sanjay
>
>
>
> -----Original Message-----
> From: Thompson Willard [mailto:[EMAIL PROTECTED]]
> Sent: 30 November 2000 12:37
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> For Excel:
>
> <%@ page contentType="application/vnd.ms-excel" %>
>
> So for Word I believe its:
>
> <%@ page contentType="application/msword" %>
>
> But you'll need to do a little more to open an already made word doc.
>
>
> -----Original Message-----
> From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 4:03 AM
> To: [EMAIL PROTECTED]
> Subject: Opening a word document file through a JSP/servlet
>
>
> Hi guys
> Could someone help me in finding a solution for this
> I have a Word document file on Server. I want to open this
> file in a JSP
>
> Could this be done if yes so how
>
> TIA
> Sanjay
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets