public class BaseController
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected static int |
DOWNLOAD_ID_COOKIE_EXPIRY
文件下载完标识,设置保存在cookie中的过期时间,单位:秒
|
protected static java.lang.String |
DOWNLOAD_ID_NAME
文件下载id参数名
|
构造器和说明 |
---|
BaseController() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
commonsDownloadEx(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String fullFilePath)
文件下载通用方法,支持大文件下载
|
protected java.util.List<UploadFileVo> |
commonsUploadEx(java.lang.String rootDir,
java.lang.String rootDirCatalog,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
上传文件通用函数
|
protected UploadFileVo |
getUploadNewFileName(java.lang.String rootDirCatalog,
java.lang.String extension,
java.lang.String oldFileName) |
protected void |
setResponseContentType(javax.servlet.http.HttpServletResponse response,
org.springframework.http.MediaType mediaType)
设置response的ContentType
|
protected void |
setResponseContentTypeAndStatus(javax.servlet.http.HttpServletResponse response,
org.springframework.http.MediaType mediaType,
org.springframework.http.HttpStatus status)
设置response的ContentType和HttpStatus
|
protected void |
setResponseHttpStatus(javax.servlet.http.HttpServletResponse response,
org.springframework.http.HttpStatus status)
设置response的HttpStatus
|
protected void |
writeJsonToResponse(javax.servlet.http.HttpServletResponse response,
RetVo retVo)
将retVo转成json后写入到response中
|
protected static final int DOWNLOAD_ID_COOKIE_EXPIRY
protected static final java.lang.String DOWNLOAD_ID_NAME
protected java.util.List<UploadFileVo> commonsUploadEx(java.lang.String rootDir, java.lang.String rootDirCatalog, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
rootDir
- 根目录rootDirCatalog
- 目录下面的子目录request
- 请求对象response
- 相应对象java.lang.Exception
- 出错会抛出异常protected UploadFileVo getUploadNewFileName(java.lang.String rootDirCatalog, java.lang.String extension, java.lang.String oldFileName) throws java.lang.Exception
java.lang.Exception
protected void commonsDownloadEx(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fullFilePath) throws java.lang.Exception
request
- 请求对象response
- 相应对象fullFilePath
- 需要下载的文件的全路径(绝对路径)java.lang.Exception
- 出错会抛出异常protected void writeJsonToResponse(javax.servlet.http.HttpServletResponse response, RetVo retVo) throws java.lang.Exception
response
- 相应对象retVo
- java.lang.Exception
- 出错会抛出异常protected void setResponseContentTypeAndStatus(javax.servlet.http.HttpServletResponse response, org.springframework.http.MediaType mediaType, org.springframework.http.HttpStatus status)
mediaType
- status
- protected void setResponseContentType(javax.servlet.http.HttpServletResponse response, org.springframework.http.MediaType mediaType)
response
- 相应对象mediaType
- protected void setResponseHttpStatus(javax.servlet.http.HttpServletResponse response, org.springframework.http.HttpStatus status)
response
- 相应对象status
-