Class AbstractXlsView
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
- All Implemented Interfaces:
- Aware, BeanNameAware, ApplicationContextAware, ServletContextAware, View
- Direct Known Subclasses:
- AbstractXlsxView
@Deprecated(since="7.0",
            forRemoval=true)
public abstract class AbstractXlsView
extends AbstractView
Deprecated, for removal: This API element is subject to removal in a future version.
Convenient superclass for Excel document views in traditional XLS format.
Compatible with Apache POI 3.5 and higher.
For working with the workbook in the subclass, see Apache's POI site
- Since:
- 4.2
- Author:
- Juergen Hoeller
- 
Field SummaryFields inherited from class AbstractViewDEFAULT_CONTENT_TYPEFields inherited from class ApplicationObjectSupportloggerFields inherited from interface ViewPATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Default Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidbuildExcelDocument(Map<String, Object> model, org.apache.poi.ss.usermodel.Workbook workbook, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Deprecated, for removal: This API element is subject to removal in a future version.Application-provided subclasses must implement this method to populate the Excel workbook document, given the model.protected org.apache.poi.ss.usermodel.WorkbookcreateWorkbook(Map<String, Object> model, jakarta.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.Template method for creating the POIWorkbookinstance.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.Return whether this view generates download content (typically binary content like PDF or Excel files).protected final voidrenderMergedOutputModel(Map<String, Object> model, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Deprecated, for removal: This API element is subject to removal in a future version.Renders the Excel view, given the specified model.protected voidrenderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, jakarta.servlet.http.HttpServletResponse response) Deprecated, for removal: This API element is subject to removal in a future version.The actual render step: taking the POIWorkbookand rendering it to the given response.Methods inherited from class AbstractViewaddStaticAttribute, 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, writeToResponseMethods inherited from class WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Constructor Details- 
AbstractXlsViewpublic AbstractXlsView()Deprecated, for removal: This API element is subject to removal in a future version.Default Constructor. Sets the content type of the view to "application/vnd.ms-excel".
 
- 
- 
Method Details- 
generatesDownloadContentprotected boolean generatesDownloadContent()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractViewReturn whether this view generates download content (typically binary content like PDF or Excel files).The default implementation returns false. Subclasses are encouraged to returntruehere if they know that they are generating download content that requires temporary caching on the client side, typically via the response OutputStream.- Overrides:
- generatesDownloadContentin class- AbstractView
- See Also:
 
- 
renderMergedOutputModelprotected final void renderMergedOutputModel(Map<String, Object> model, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws ExceptionDeprecated, for removal: This API element is subject to removal in a future version.Renders the Excel view, given the specified model.- Specified by:
- renderMergedOutputModelin class- AbstractView
- Parameters:
- model- combined output Map (never- null), with dynamic values taking precedence over static attributes
- request- current HTTP request
- response- current HTTP response
- Throws:
- Exception- if rendering failed
 
- 
createWorkbookprotected org.apache.poi.ss.usermodel.Workbook createWorkbook(Map<String, Object> model, jakarta.servlet.http.HttpServletRequest request) Deprecated, for removal: This API element is subject to removal in a future version.Template method for creating the POIWorkbookinstance.The default implementation creates a traditional HSSFWorkbook. Spring-provided subclasses are overriding this for the OOXML-based variants; custom subclasses may override this for reading a workbook from a file.- Parameters:
- model- the model Map
- request- current HTTP request (for taking the URL or headers into account)
- Returns:
- the new Workbookinstance
 
- 
renderWorkbookprotected void renderWorkbook(org.apache.poi.ss.usermodel.Workbook workbook, jakarta.servlet.http.HttpServletResponse response) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.The actual render step: taking the POIWorkbookand rendering it to the given response.- Parameters:
- workbook- the POI Workbook to render
- response- current HTTP response
- Throws:
- IOException- when thrown by I/O methods that we're delegating to
 
- 
buildExcelDocumentprotected abstract void buildExcelDocument(Map<String, Object> model, org.apache.poi.ss.usermodel.Workbook workbook, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws ExceptionDeprecated, for removal: This API element is subject to removal in a future version.Application-provided subclasses must implement this method to populate the Excel workbook document, given the model.- Parameters:
- model- the model Map
- workbook- the Excel workbook to populate
- request- in case we need locale etc. Shouldn't look at attributes.
- response- in case we need to set cookies. Shouldn't write to it.
- Throws:
- Exception
 
 
- 
Viewclass or perform rendering in web handlers directly.