jsp下载word

<%@ page language="java" contentType="application/msword;charset=utf-8"%>
<%@ page import="java.net.URLEncoder"%>
<html>
<head><title>word下载</title></head>
<body>
<%
response.setHeader("Content-Disposition","attachement;filename="+URLEncoder.encode("产假","utf-8")) ;
%>
<table >
<tr><td>word下载,请注意文件头改变了</td></tr>
<tr><td>word下载,请注意文件头改变了</td></tr>
</table>
</body>
</html>

posted @ 2016-10-10 13:37  江山一族  阅读(579)  评论(0编辑  收藏  举报