类 AbstractHandlerMethodAdapter
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.context.support.WebApplicationObjectSupport
- org.springframework.web.servlet.support.WebContentGenerator
- org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter
- 所有已实现的接口:
Aware
,ApplicationContextAware
,Ordered
,ServletContextAware
,HandlerAdapter
- 直接已知子类:
RequestMappingHandlerAdapter
public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator implements HandlerAdapter, Ordered
Abstract base class forHandlerAdapter
implementations that support handlers of typeHandlerMethod
.- 从以下版本开始:
- 3.1
- 作者:
- Arjen Poutsma
字段概要
从类继承的字段 org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AbstractHandlerMethodAdapter()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 long
getLastModified(HttpServletRequest request, Object handler)
This implementation expects the handler to be anHandlerMethod
.protected abstract long
getLastModifiedInternal(HttpServletRequest request, HandlerMethod handlerMethod)
Same contract as forHttpServlet.getLastModified(HttpServletRequest)
.int
getOrder()
Get the order value of this object.ModelAndView
handle(HttpServletRequest request, HttpServletResponse response, Object handler)
This implementation expects the handler to be anHandlerMethod
.protected abstract ModelAndView
handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod)
Use the given handler method to handle the request.void
setOrder(int order)
Specify the order value for this HandlerAdapter bean.boolean
supports(Object handler)
This implementation expects the handler to be anHandlerMethod
.protected abstract boolean
supportsInternal(HandlerMethod handlerMethod)
Given a handler method, return whether or not this adapter can support it.从类继承的方法 org.springframework.web.servlet.support.WebContentGenerator
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
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
AbstractHandlerMethodAdapter
public AbstractHandlerMethodAdapter()
方法详细资料
setOrder
public void setOrder(int order)
Specify the order value for this HandlerAdapter bean.The default value is
Ordered.LOWEST_PRECEDENCE
, meaning non-ordered.- 另请参阅:
Ordered.getOrder()
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
supports
public final boolean supports(Object handler)
This implementation expects the handler to be anHandlerMethod
.- 指定者:
supports
在接口中HandlerAdapter
- 参数:
handler
- the handler instance to check- 返回:
- whether or not this adapter can adapt the given handler
supportsInternal
protected abstract boolean supportsInternal(HandlerMethod handlerMethod)
Given a handler method, return whether or not this adapter can support it.- 参数:
handlerMethod
- the handler method to check- 返回:
- whether or not this adapter can adapt the given method
handle
public final ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
This implementation expects the handler to be anHandlerMethod
.- 指定者:
handle
在接口中HandlerAdapter
- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandler
- handler to use. This object must have previously been passed to thesupports
method of this interface, which must have returnedtrue
.- 返回:
- ModelAndView object with the name of the view and the required model data, or
null
if the request has been handled directly - 抛出:
Exception
- in case of errors
handleInternal
protected abstract ModelAndView handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) throws Exception
Use the given handler method to handle the request.- 参数:
request
- current HTTP requestresponse
- current HTTP responsehandlerMethod
- handler method to use. This object must have previously been passed to thesupportsInternal(HandlerMethod)
this interface, which must have returnedtrue
.- 返回:
- ModelAndView object with the name of the view and the required model data, or
null
if the request has been handled directly - 抛出:
Exception
- in case of errors
getLastModified
public final long getLastModified(HttpServletRequest request, Object handler)
This implementation expects the handler to be anHandlerMethod
.- 指定者:
getLastModified
在接口中HandlerAdapter
- 参数:
request
- current HTTP requesthandler
- handler to use- 返回:
- the lastModified value for the given handler
- 另请参阅:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)
,LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
getLastModifiedInternal
protected abstract long getLastModifiedInternal(HttpServletRequest request, HandlerMethod handlerMethod)
Same contract as forHttpServlet.getLastModified(HttpServletRequest)
.- 参数:
request
- current HTTP requesthandlerMethod
- handler method to use- 返回:
- the lastModified value for the given handler