使用excelutils导出excel非常简单,这里不做很多的介绍,直接贴出代码:
所需要的包有commons-beanutils-1.8.0.jar,commons-digester-1.8.jar,commons-logging-1.1.1.jar,excelutils.jar,poi-3.8-20120326.jar,主要有这五个jar包。
@Controller public class ExportTest { @RequestMapping("/exportTest") public void exportTest(HttpServletRequest request, HttpServletResponse response) throws ExcelException, FileNotFoundException { String path="/hello.xls"; File file = new File(path); FileOutputStream fop = new FileOutputStream(file); ExcelUtils.addValue("name","zhangqi")