怎么没回答啊。这可不是CSDN的风格噢!!!!!!先谢大家了

解决方案 »

  1.   

    主要可以将当前页面以WORD形式,另存为html,改换成JSP文件将在文件中将相关数据加入,转化为JSP时
    <%@ page contentType="application/msword;charset=GB2312" errorPage = "/home/errPage.jsp" language="java" %>
      

  2.   

     response.setHeader("content-disposition", "attachment; filename="+"第一学期期中英语测试_"+SysDate+".word");这一句就可以把<body></body> 里面的东西转为word文档。而且下载下了。
      

  3.   

    可以利用table把试卷输出,然后利用JavaScript保存此表格为Word文档。
    //下面代码为引用论坛其他人的回复,自己没测试过
    App为表格ID,你调用一下SaveAs函数. 
    function   PrintFile()   
      {   
      var   strResult=window.confirm("确认用Word打印吗?");   
      if(strResult)   
      {   
      try   
      {   
      App.focus();   
      document.execCommand("SelectAll");   
      document.execCommand("Copy");   
      App.focus();   
      var   WordApp=new   ActiveXObject("Word.Application");   
      WordApp.Application.Visible=true;   
      var   Doc=WordApp.Documents.Add();   
      Doc.Activate();   
      Doc.Content.Paste();   
      Doc.PrintPreview();   
      WordApp.DisplayAlerts=false;   
      Doc.Close();   
      WordApp.DisplayAlerts=true;   
      WordApp.Quit();   
      }   
      catch(e){}   
      }   
      else   
      {   
      var   hwnd=window.open("");   
      hwnd.document.write(App.innerHTML);   
      }   
      return   false;   
      }
      

  4.   

    <%@ page contentType="application/msword; charset=gb2312"  import="java.util.*" %>