Page Layout
Click Export User: trigger functions directly to the back
Background follows:
public String export()throws Exception{ Connection con=null; try { con=dbUtil.getCon(); Workbook wb = new HSSFWorkbook (); // create a workbook String headers [] = { "number", "name", "telephone", "Email", "QQ"}; ResultSet rs=userDao.userList(con, null); ExcelUtil.fillExcelData(rs, wb, headers); ResponseUtil.export(ServletActionContext.getResponse(), wb, "导出excel.xls"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace (); }finally{ try { dbUtil.closeCon(con); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace (); } } return null; }