public abstract class AbstractPOIExcelView
extends org.springframework.web.servlet.view.AbstractView
NOTE: 엑셀 서비스를 제공하기 위해 유용한 유틸을 포함하는 클래스이다.
== 개정이력(Modification Information) == 수정일 수정자 수정내용 ------------ -------- --------------------------- 2013.05.22 이기하 최초 생성 2015.06.02 장동한 filename 변경로직 추가
| Constructor and Description |
|---|
AbstractPOIExcelView()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
buildExcelDocument(Map<String,Object> model,
org.apache.poi.xssf.usermodel.XSSFWorkbook workbook,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Subclasses must implement this method to create an Excel HSSFWorkbook
document, given the model.
|
protected boolean |
generatesDownloadContent() |
protected org.apache.poi.xssf.usermodel.XSSFCell |
getCell(org.apache.poi.xssf.usermodel.XSSFSheet sheet,
int row,
int col)
Convenient method to obtain the cell in the given sheet, row and column.
|
protected void |
renderMergedOutputModel(Map<String,Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Renders the Excel view, given the specified model.
|
protected void |
setText(org.apache.poi.xssf.usermodel.XSSFCell cell,
String text)
Convenient method to set a String as text content in a cell.
|
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponsegetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic AbstractPOIExcelView()
protected boolean generatesDownloadContent()
generatesDownloadContent in class org.springframework.web.servlet.view.AbstractViewprotected final void renderMergedOutputModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
renderMergedOutputModel in class org.springframework.web.servlet.view.AbstractViewExceptionprotected abstract void buildExcelDocument(Map<String,Object> model, org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
model - the model Mapworkbook - the Excel workbook to completerequest - in case we need locale etc. Shouldn't look at attributes.response - in case we need to set cookies. Shouldn't write to it.Exceptionprotected org.apache.poi.xssf.usermodel.XSSFCell getCell(org.apache.poi.xssf.usermodel.XSSFSheet sheet,
int row,
int col)
Creates the row and the cell if they still doesn't already exist. Thus, the column can be passed as an int, the method making the needed downcasts.
sheet - a sheet object. The first sheet is usually obtained by workbook.getSheetAt(0)row - thr row numbercol - the column numberprotected void setText(org.apache.poi.xssf.usermodel.XSSFCell cell,
String text)
cell - the cell in which the text must be puttext - the text to put in the cellCopyright © 2015. All rights reserved.