發送請求地址
public String createExcel() {
try {
HttpServletResponse response = ServletActionContext
OutputStream os = response
response
response
//設置響應頭
response
HSSFWorkbook hwb = new HSSFWorkbook();
HSSFSheet sheet = hwb
hwb
HSSFRow row = sheet
sheet
createCell(hwb
createCell(hwb
createCell(hwb
createCell(hwb
createCell(hwb
//busBeans列表
for (int i =
HSSFRow row
for (int j =
if (j ==
createCell(hwb
} else if (j ==
createCell(hwb
} else if (j ==
createCell(hwb
} else if (j ==
createCell(hwb
} else if (j ==
createCell(hwb
}
}
hwb
os
return
} catch (Throwable e) {
e
this
}
return
}
public void createCell(HSSFWorkbook wb
HSSFCell cell = row
cell
HSSFCellStyle cellStyle = wb
cellStyle
cell
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26089.html