简介:
Excel文件的解析与读取普通的文本文件不同,就像xml文件的解析,最常用的Java4J方式也是jar包支持的, 根据apache官方文档:http://poi.apache.org/spreadsheet/index.html,“Also please be aware that as the new XSSF supported Excel 2007 OOXML (.xlsx) files are XML based, the memory footprint for processing them is higher than for the older HSSF supported (.xls) binary files”,很显然, .xls格式的excel文件需要HSSF支持,需要相应的poi.jar,.xlsx格式的excel文件需要XSSF支持,需要poi-ooxml.jar, 然而,该jar包还依赖其他jar包:poi-ooxml-schemas和xml,但是,在用普通web项目上,我添加了这两个jar包还是出错=.= 所以最后决定创建maven web工程来写,只需要添加了poi和poi-ooxml的依赖即可,maven的jar管理功能真的很惊艳~开心~
org.apache.poi
poi
3.15
org.apache.poi
poi-ooxml
3.15
代码实例:
1.index.jsp
|