|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter
public abstract class AbstractHandlerMethodAdapter
Abstract base class for HandlerAdapter implementations that support
handlers of type HandlerMethod.
| Field Summary |
|---|
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
METHOD_GET, METHOD_HEAD, METHOD_POST |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
AbstractHandlerMethodAdapter()
|
|
| Method Summary | |
|---|---|
long |
getLastModified(HttpServletRequest request,
Object handler)
Same contract as for HttpServlet's getLastModified method. |
protected abstract long |
getLastModifiedInternal(HttpServletRequest request,
HandlerMethod handlerMethod)
Same contract as for HttpServlet.getLastModified(HttpServletRequest). |
int |
getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting. |
ModelAndView |
handle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
Use the given handler to handle this request. |
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)
Given a handler instance, return whether or not this HandlerAdapter can support it. |
protected abstract boolean |
supportsInternal(HandlerMethod handlerMethod)
Given a handler method, return whether or not this adapter can support it. |
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractHandlerMethodAdapter()
| Method Detail |
|---|
public void setOrder(int order)
Default value is Integer.MAX_VALUE, meaning that it's non-ordered.
Ordered.getOrder()public int getOrder()
OrderedNormally starting with 0, with Integer.MAX_VALUE
indicating the greatest value. Same order values will result
in arbitrary positions for the affected objects.
Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).
getOrder in interface Orderedpublic final boolean supports(Object handler)
A typical implementation:
return (handler instanceof MyHandler);
This implementation expects the handler to be an HandlerMethod.
supports in interface HandlerAdapterhandler - the handler instance to check
protected abstract boolean supportsInternal(HandlerMethod handlerMethod)
handlerMethod - the handler method to check
public final ModelAndView handle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
throws Exception
This implementation expects the handler to be an HandlerMethod.
handle in interface HandlerAdapterrequest - current HTTP requestresponse - current HTTP responsehandler - handler to use. This object must have previously been passed
to the supports method of this interface, which must have
returned true.
null if the request has been handled directly
Exception - in case of errors
protected abstract ModelAndView handleInternal(HttpServletRequest request,
HttpServletResponse response,
HandlerMethod handlerMethod)
throws Exception
request - current HTTP requestresponse - current HTTP responsehandlerMethod - handler method to use. This object must have previously been passed to the
supportsInternal(HandlerMethod) this interface, which must have returned true.
null if
the request has been handled directly
Exception - in case of errors
public final long getLastModified(HttpServletRequest request,
Object handler)
getLastModified method.
Can simply return -1 if there's no support in the handler class. This implementation expects the handler to be an HandlerMethod.
getLastModified in interface HandlerAdapterrequest - current HTTP requesthandler - handler to use
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest),
LastModified.getLastModified(javax.servlet.http.HttpServletRequest)
protected abstract long getLastModifiedInternal(HttpServletRequest request,
HandlerMethod handlerMethod)
HttpServlet.getLastModified(HttpServletRequest).
request - current HTTP requesthandlerMethod - handler method to use
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||