Class AbstractXlsxStreamingView
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.context.support.WebApplicationObjectSupport
- org.springframework.web.servlet.view.AbstractView
- org.springframework.web.servlet.view.document.AbstractXlsView
- org.springframework.web.servlet.view.document.AbstractXlsxView
- org.springframework.web.servlet.view.document.AbstractXlsxStreamingView
- All Implemented Interfaces:
Aware
,BeanNameAware
,ApplicationContextAware
,ServletContextAware
,View
public abstract class AbstractXlsxStreamingView extends AbstractXlsxView
Convenient superclass for Excel document views in the Office 2007 XLSX format, using POI's streaming variant. Compatible with Apache POI 3.9 and higher.For working with the workbook in subclasses, see Apache's POI site.
- Since:
- 4.2
- Author:
- Juergen Hoeller
Field Summary
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
Constructor Summary
Constructors Constructor Description AbstractXlsxStreamingView()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.poi.xssf.streaming.SXSSFWorkbook
createWorkbook(Map<String,Object> model, HttpServletRequest request)
This implementation creates aSXSSFWorkbook
for streaming the XLSX format.protected void
renderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, HttpServletResponse response)
This implementation disposes of theSXSSFWorkbook
when done with rendering.Methods inherited from class org.springframework.web.servlet.view.document.AbstractXlsView
buildExcelDocument, generatesDownloadContent, renderMergedOutputModel
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
Constructor Detail
AbstractXlsxStreamingView
public AbstractXlsxStreamingView()
Method Detail
createWorkbook
protected org.apache.poi.xssf.streaming.SXSSFWorkbook createWorkbook(Map<String,Object> model, HttpServletRequest request)
This implementation creates aSXSSFWorkbook
for streaming the XLSX format.- Overrides:
createWorkbook
in classAbstractXlsxView
- Parameters:
model
- the model Maprequest
- current HTTP request (for taking the URL or headers into account)- Returns:
- the new
Workbook
instance
renderWorkbook
protected void renderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, HttpServletResponse response) throws IOException
This implementation disposes of theSXSSFWorkbook
when done with rendering.- Overrides:
renderWorkbook
in classAbstractXlsView
- Parameters:
workbook
- the POI Workbook to renderresponse
- current HTTP response- Throws:
IOException
- when thrown by I/O methods that we're delegating to- See Also:
SXSSFWorkbook.dispose()