Package org.springframework.web.servlet.view.document

# Class AbstractXlsxView

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

All Implemented Interfaces:
  `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanNameAware`, `org.springframework.context.ApplicationContextAware`, `org.springframework.web.context.ServletContextAware`, `View`

Direct Known Subclasses:
  `AbstractXlsxStreamingView`

public abstract class AbstractXlsxView extends AbstractXlsView
Convenient superclass for Excel document views in the Office 2007 XLSX format (as supported by POI-OOXML). Compatible with Apache POI 3.5 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
`AbstractXlsxView()`
Default Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected org.apache.poi.ss.usermodel.Workbook`
`createWorkbook(Map<String,Object> model, HttpServletRequest request)`
This implementation creates an `XSSFWorkbook` for the XLSX format.

### Methods inherited from class org.springframework.web.servlet.view.document.AbstractXlsView

`buildExcelDocument, generatesDownloadContent, renderMergedOutputModel, renderWorkbook`

### Methods inherited from class org.springframework.web.servlet.view.AbstractView

`addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, 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, obtainApplicationContext, requiredContextClass, setApplicationContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AbstractXlsxView

public AbstractXlsxView()
Default Constructor.

Sets the content type of the view to `"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"`.

## Method Details

### createWorkbook

protected org.apache.poi.ss.usermodel.Workbook createWorkbook(Map<String,Object> model, HttpServletRequest request)
This implementation creates an `XSSFWorkbook` for the XLSX format.

Overrides:
  `createWorkbook` in class `AbstractXlsView`
Parameters:
  `model` - the model Map
  `request` - current HTTP request (for taking the URL or headers into account)
Returns:
  the new `Workbook` instance