具体什么意思,是否想在netscape看doc文件。

解决方案 »

  1.   

    是呀!我用
    <mime-mapping>
            <extension>
                doc
            </extension>
            <mime-type>
                application/msword
            </mime-type>
        </mime-mapping>
    不行
    web.xml
      

  2.   

    啊,这样行吗!?
    看看apache Cocoon.
      

  3.   

    是不是在XML里存着DOC的数据,在好象上面指定数据的类型,让netscape看。
      

  4.   

    http://xml.apache.org/cocoon/install.html#tomcat
      

  5.   

    不是呀,是直接关联的
    例如:http://www.test.com/ccc.doc
      

  6.   

    是不是XML里指着DOC 文件的路径,在好象上面指定数据的类型,让netscape显示。
      

  7.   

    不是XML里指着DOC 文件的路径,是在jsp里指定的。
    怎么办呀?
      

  8.   

    在JSP里读取DOC的文件流输出到response.getOutputStream()里不就可以吗。
      

  9.   

    response.getOutputStream()
    能对中文起作用吗,现在是乱码呀!?
      

  10.   

    问题是希望看到word形式的页面。而不是乱吗,或
    乱排的页面。
      

  11.   

    我写了一个servlet,但是他提示下载*.doc文件,而不是显示word文档。import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class FileView extends HttpServlet
    {    private ServletConfig config = null;
        private String xFilePath = null;
        private String strDefaultDir = null;
        private String separator = null;    public FileView()
        {
       
            separator = System.getProperty("file.separator");
        }    public final void init(ServletConfig servletconfig)
            throws ServletException
        {
            config = servletconfig;
        }    public final ServletConfig getServletConfig()
        {
            return config;
        }    public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
        {
            doPost(httpservletrequest, httpservletresponse);
        }    public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
        {
         
            String s1 = httpservletrequest.getParameter("name");
            String s = httpservletrequest.getParameter("path");
         
                GetFile(s, s1, httpservletresponse);
            
        }    private void GetFile(String s, String s1, HttpServletResponse httpservletresponse)
            throws IOException
        {
            httpservletresponse.setContentType("application/msword; name=" + s1 + "\"");
            httpservletresponse.setHeader("Content-Disposition", "inline;filename=" + s1 + "\"");
            javax.servlet.ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
            dumpFile(s, servletoutputstream);
            servletoutputstream.flush();
            servletoutputstream.close();
        }    private void dumpFile(String s, OutputStream outputstream)
        {
            byte abyte0[] = new byte[4096];
            try
            {
                FileInputStream fileinputstream = new FileInputStream(s);
                int i;
                while((i = fileinputstream.read(abyte0)) != -1) 
                    outputstream.write(abyte0, 0, i);            fileinputstream.close();
            }
            catch(Exception exception)
            {
                System.out.println(exception);
            }
        }
    }
      

  12.   

    奥!!!!!!!!!!!!!!!
    原来我的netscape没装word97插件.
    搞死我了!!!!!!1
    !!!!