jsp 简单下载

<%@ page language="java" import="java.util.*" contentType="text/html;charset=GBK"%>

<%
	String sql ="delete from abc";
	response.setContentType("text/plain");
	response.setHeader("content-disposition","attachment; filename=ccccc.sql.txt");
	response.setHeader("Content_Length", sql.length()+"");
	response.setCharacterEncoding("GBK");


	out.write(sql);
	out.flush();
	out = pageContext.pushBody();
%>

 

posted @ 2014-07-25 10:39  哈特中尉  阅读(75)  评论(0编辑  收藏  举报