[代码] [Java]代码 import java.io.IOException; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class PoiRender extends Render { private HSSFWorkbook wb; private String name; public Exc http://www.starkp.com/linked/20130228.do; elRender(HSSFWorkbook wb, String name){ this.wb = wb; this.name = name; } public void render() { response.addHeader("Content-disposition", "attachment; filename=" name); response.setContentType("application/x-msdownload"); try { wb.write(response.getOutputStream()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } http://wj.aaafaipiao.com/linked/20130228.do;
转载于:https://www.cnblogs.com/fpqqchao/archive/2013/03/01/2938010.html