public class ImageController
extends com.seeyon.ctp.common.controller.BaseController
Title: 通用图片Controller
Description:
1、用于显示图片,
Rest HTTP使用 : CommonImageResource
移动端 H5使用 : cmp.util.getImageUrl(options)
Copyright: Copyright (c) 2016
Company: seeyon.com
DATA_NO_EXISTS, MATCH_ALL, needlessClassMap, needlessUrlMap, POLICY_ALLOW, POLICY_LOG, POLICY_REJECT, REDIRECT_BACK, rulePolicyMap
构造器和说明 |
---|
ImageController() |
限定符和类型 | 方法和说明 |
---|---|
org.springframework.web.servlet.ModelAndView |
showImage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Description: 查看图片Controller
示例URL: http://xxx:port/contextPath/image.do? |
addValidator, buildView, forward, getCommandName, getUri, handleRequestInternal, index, infoCloseOrFresh, initBinder, noCache, preBind, printV3XJS, printV3XJS, recheck, redirect, redirectModelAndView, redirectModelAndView, refreshWindow, refreshWindow, refreshWorkspace, rendHtml, rendJavaScript, rendJavaScriptUnclose, rendText
bind, createBinder, getExceptionHandler, getLastModified, getMethodNameResolver, getValidators, getWebBindingInitializer, handleNoSuchRequestHandlingMethod, invokeNamedMethod, newCommandObject, setDelegate, setMethodNameResolver, setValidators, setWebBindingInitializer
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
@SetContentType public org.springframework.web.servlet.ModelAndView showImage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws com.seeyon.ctp.common.exceptions.BusinessException
Description: 查看图片Controller
示例URL:
http://xxx:port/contextPath/image.do?method=showImage&id={fileId|showImageId}&size={Source|Original|Custom}&h={12}&w={35}&handler={handlerName}
http://xxx:port/contextPath/commonimage.do?method=showImage&id={fileId|showImageId}&size={Source|Original|Custom}&h={12}&w={35}&handler={handlerName}
id:表示自定义尺寸,h表示要切图片的高,w表示要切图片的宽
size: custom:表示自定义尺寸,h表示要切图片的高,w表示要切图片的宽、source:图片源文件、original:图片等比压缩后的图片,该图片的高和宽不会变;auto动态自动计算算法(用于大图查看)--尽量让图片小并且不失真
h:要切图的高,只对size=custom有效
w:要切图的宽,只对size=custom有效
handler:如果文件不是通过Id不能从FileManager中获取,则可以通过实行
ImageHandler
来获取图片文件
request
- response
- com.seeyon.ctp.common.exceptions.BusinessException
ImageHandler