不用费什么劲,你在JSP中加入
response.setContentType("application/msword");就OK了~~~
GOOD LUCK!~~

解决方案 »

  1.   

    然后你就可以用
    <%@ page contentType="text/html;charset=gb2312"%>
    <%@ page import="java.io.*" %>
    <%
    String filePath="c:/aa.doc";
    filePath=filePath.toString();
    File myFilePath=new File(filePath);
    if(!myFilePath.exists())
    myFilePath.createNewFile();
    FileWriter resultFile=new FileWriter(myFilePath);
    PrintWriter myFile=new PrintWriter(resultFile);
    myFile.println("aaaa");
    resultFile.close();
    %>
    简单操作了。
      

  2.   

    我会用这种方法,但是它不能生成页眉和页脚。我想用poi包的可以生成页眉和页脚