spring4.2中引入的Excel处理类

处理Excel文件使用的是Apache POI

http://poi.apache.org/spreadsheet/index.html

旧类:AbstractExcelView

http://docs.spring.io/spring/docs/4.2.2.BUILD-SNAPSHOT/javadoc-api//org/springframework/web/servlet/view/document/AbstractExcelView.html

新类:(Spring4.2以后引入)

AbstractXlsView 

AbstractXlsxView
AbstractXlsxStreamingView

关于Spring中视图类的更新, 作者说的一段话:

juergen.hoeller Juergen Hoeller added a comment - 23/Mar/15 9:46 AM

Based on your suggestions, I've introduced AbstractXlsView, AbstractXlsxView and AbstractXlsxStreamingView variants, designed to work as closely as possible with POI 3.8+'s arrangements. The traditional (pre POI 3.5) AbstractExcelView has been marked as deprecated, just like AbstractJExcelView already is.

I went with separate classes (in a hierarchy) primarily for minimum dependencies imposed, i.e. no poi-ooxml dependency needed when just using HSSF. As a side benefit, the content type can also be determined in the constructor then, and the SXSSFWorkbook.dispose call can be applied in a cleaner fashion.

This will be available in the upcoming 4.2 snapshot. Feel free to give it a try...

Note that AbstractXmlxStreamingView requires POI 3.9+ due to the pretty important SXSSFWorkbook.dispose() method only being available there.

We recommend the use of POI 3.10+ where we support close() calls for existing resources in a worksheet. We do that conditionally based on an instanceof Closeable check in order to preserve POI 3.5+ compatibility in AbstractXslView and AbstractXlsxView.

Juergen

 

Class AbstractXlsxStreamingView

http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/view/document/AbstractXlsxStreamingView.html
 
jira.spring.io
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值