• jsp导出word


    
    
    <%@ page contentType="application/vnd.ms-word; charset=utf-8"%>
    <%@ page pageEncoding="utf-8"%>
     
    <%  
        String fileName = "jsp导出word.doc";  
          //对中文文件名编码  
       //fileName = URLEncoder.encode(fileName, "utf-8");  
        byte[] yte = fileName.getBytes("GB2312");  
                String unicoStr = new String(yte, "ISO-8859-1");
       response.setHeader("Content-disposition", "attachment; filename=" + unicoStr);  
    %>  
     
    <html xmlns:v="urn:schemas-microsoft-com:vml"   
          xmlns:o="urn:schemas-microsoft-com:office:office"   
          xmlns:w="urn:schemas-microsoft-com:office:word"   
          xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"   
          xmlns:st1="urn:schemas-microsoft-com:office:smarttags"   
          xmlns="http://www.w3.org/TR/REC-html40">  
    <head>  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
    <meta name="ProgId" content="Word.Document">  
    <meta name="Generator" content="Microsoft Word 12">  
    <meta name="Originator" content="Microsoft Word 12">   
    <title>JSP页面导出为Word文档</title>  
    </head>  
    <body>  
    。。。页面内容。。。  
    </body>  
    </html> 

     http://blog.sina.com.cn/s/blog_59e2a4100100kejd.html
  • 相关阅读:
    js操作class值
    四、多表连接
    三、约束
    根据出生日期计算年龄
    二、MySql数据操作(二)
    一、MySql基本语句(一)
    jquery基本操作
    纯js实现全选,全不选,反选
    css的基础知识1
    表格的使用
  • 原文地址:https://www.cnblogs.com/passer1991/p/2993753.html
Copyright © 2020-2023  润新知