类 ServletInvocableHandlerMethod
- java.lang.Object
- org.springframework.web.method.HandlerMethod
- org.springframework.web.method.support.InvocableHandlerMethod
- org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod
public class ServletInvocableHandlerMethod extends InvocableHandlerMethod
ExtendsInvocableHandlerMethod
with the ability to handle return values through a registeredHandlerMethodReturnValueHandler
and also supports setting the response status based on a method-level@ResponseStatus
annotation.A
null
return value (including void) may be interpreted as the end of request processing in combination with a@ResponseStatus
annotation, a not-modified check condition (seeServletWebRequest.checkNotModified(long)
), or a method argument that provides access to the response stream.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
嵌套类概要
从类继承的嵌套类/接口 org.springframework.web.method.HandlerMethod
HandlerMethod.HandlerMethodParameter
字段概要
从类继承的字段 org.springframework.web.method.HandlerMethod
logger
构造器概要
构造器 构造器 说明 ServletInvocableHandlerMethod(Object handler, Method method)
Creates an instance from the given handler and method.ServletInvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from aHandlerMethod
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
invokeAndHandle(ServletWebRequest webRequest, ModelAndViewContainer mavContainer, Object... providedArgs)
Invoke the method and handle the return value through one of the configuredHandlerMethodReturnValueHandler
s.void
setHandlerMethodReturnValueHandlers(HandlerMethodReturnValueHandlerComposite returnValueHandlers)
RegisterHandlerMethodReturnValueHandler
instances to use to handle return values.从类继承的方法 org.springframework.web.method.support.InvocableHandlerMethod
doInvoke, getDetailedErrorMessage, invokeForRequest, setDataBinderFactory, setHandlerMethodArgumentResolvers, setParameterNameDiscoverer
从类继承的方法 org.springframework.web.method.HandlerMethod
createWithResolvedBean, equals, getBean, getBeanType, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getResolvedFromHandlerMethod, getResponseStatus, getResponseStatusReason, getReturnType, getReturnValueType, getShortLogMessage, hashCode, hasMethodAnnotation, isVoid, toString
构造器详细资料
ServletInvocableHandlerMethod
public ServletInvocableHandlerMethod(Object handler, Method method)
Creates an instance from the given handler and method.
ServletInvocableHandlerMethod
public ServletInvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from aHandlerMethod
.
方法详细资料
setHandlerMethodReturnValueHandlers
public void setHandlerMethodReturnValueHandlers(HandlerMethodReturnValueHandlerComposite returnValueHandlers)
RegisterHandlerMethodReturnValueHandler
instances to use to handle return values.
invokeAndHandle
public void invokeAndHandle(ServletWebRequest webRequest, ModelAndViewContainer mavContainer, Object... providedArgs) throws Exception
Invoke the method and handle the return value through one of the configuredHandlerMethodReturnValueHandler
s.- 参数:
webRequest
- the current requestmavContainer
- the ModelAndViewContainer for this requestprovidedArgs
- "given" arguments matched by type (not resolved)- 抛出:
Exception