java匯出word實現方式一,在jsp中實現
阿新 • • 發佈:2019-01-31
參考:http://ll-feng.iteye.com/blog/345873
在jsp頁面中引入下面:
- <%@ page contentType="application/vnd.ms-word; charset=utf-8"%>
- <%@page pageEncoding="utf-8"%>
- <%@ page import="java.net.URLEncoder" %>
- <%
- String fileName = "各單位接收通知情況統計.doc";
-
//fileName = URLEncoder.encode("各單位接收通知情況統計","UTF-8")+".doc";
- response.setHeader("Content-disposition","attachment; filename="+ExportUtil.UniC(fileName));%>
-
<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"
- <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"