jsp 导出excel
来源:互联网 发布:陕西和泰单片机 编辑:程序博客网 时间:2024/04/30 19:43
@ResponseBody@RequestMapping(produces = "text/html;charset=UTF-8", value="/download", method=RequestMethod.GET)public String doDownload(HttpServletResponse response){Map<String, String> map = new HashMap<String,String>();String[] header={"联系方式","姓名","状态"};List<Phone> list = new ArrayList<Phone>();for (int i = 0; i < 20; i++) {Phone phone = new Phone();phone.setName("name"+i);phone.setPhone("1343299477"+i);phone.setStatus(UserStatus.FAILURE);list.add(phone);}Workbook wb = WriteExcelUtil.createWorkbook(list,header);OutputStream out = null;try {out = response.getOutputStream();String showFileName = "MobileList.xls";response.addHeader("Content-disposition","attachment; filename=\"" + showFileName + "\"");response.setContentType("text/html;charset=UTF-8");wb.write(out);} catch (IOException e) {e.printStackTrace();}finally {//关闭流try {out.close();} catch (IOException e) {e.printStackTrace();}}return "";}
0 0
- jsp导出excel poi
- jsp导出Excel
- jsp导出Excel(续)
- jsp 导出 word excel
- JSP导出Excel文档
- jsp导出Excel
- jsp导出Excel
- jsp导出Excel
- JSP导出EXCEL
- jsp导出Excel
- jsp实现导出(Excel)
- jsp 导出 excel
- jsp页面导出excel
- jsp导出excel
- jsp导出excel
- jsp导出数据(excel)
- jsp数据导出excel
- [JSP] - [导出EXCEL]
- iOS开发经验
- 架构设计(重业务:后期制作不同业务的sdk)
- UDP和TCP
- String转date sql 数据库日期查询
- Assembly x64 Intro - Arrays
- jsp 导出excel
- 导航
- node.js Buffer常用方法
- 简单分析如何使用aggregate_instance_extra_spec filter
- 跨境电商集体来莞借船出海
- Caffe安装 使用
- 获取搜索Key值
- 内存池的实现(二)
- python基础教程共60课-第19课函数