Class ServletInvocableHandlerMethod
java.lang.Object
org.springframework.web.method.HandlerMethod
org.springframework.web.method.support.InvocableHandlerMethod
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod
Extends 
InvocableHandlerMethod with the ability to handle return
 values through a registered HandlerMethodReturnValueHandler 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
 (see ServletWebRequest.checkNotModified(long)), or
 a method argument that provides access to the response stream.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.web.method.HandlerMethodHandlerMethod.HandlerMethodParameter
- 
Field SummaryFields inherited from class org.springframework.web.method.HandlerMethodlogger
- 
Constructor SummaryConstructorsConstructorDescriptionServletInvocableHandlerMethod(Object handler, Method method) Creates an instance from the given handler and method.ServletInvocableHandlerMethod(Object handler, Method method, MessageSource messageSource) Variant ofServletInvocableHandlerMethod(Object, Method)that also accepts aMessageSource, e.g.ServletInvocableHandlerMethod(HandlerMethod handlerMethod) Create an instance from aHandlerMethod.
- 
Method SummaryModifier and TypeMethodDescriptionvoidinvokeAndHandle(ServletWebRequest webRequest, ModelAndViewContainer mavContainer, Object... providedArgs) Invoke the method and handle the return value through one of the configuredHandlerMethodReturnValueHandlers.voidsetHandlerMethodReturnValueHandlers(HandlerMethodReturnValueHandlerComposite returnValueHandlers) RegisterHandlerMethodReturnValueHandlerinstances to use to handle return values.Methods inherited from class org.springframework.web.method.support.InvocableHandlerMethoddoInvoke, getMethodArgumentValues, invokeForRequest, setDataBinderFactory, setHandlerMethodArgumentResolvers, setParameterNameDiscovererMethods inherited from class org.springframework.web.method.HandlerMethodassertTargetBean, createWithResolvedBean, equals, findProvidedArgument, formatArgumentError, formatInvokeError, getBean, getBeanType, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getResolvedFromHandlerMethod, getResponseStatus, getResponseStatusReason, getReturnType, getReturnValueType, getShortLogMessage, hashCode, hasMethodAnnotation, isVoid, toString
- 
Constructor Details- 
ServletInvocableHandlerMethodCreates an instance from the given handler and method.
- 
ServletInvocableHandlerMethodpublic ServletInvocableHandlerMethod(Object handler, Method method, @Nullable MessageSource messageSource) Variant ofServletInvocableHandlerMethod(Object, Method)that also accepts aMessageSource, e.g. to resolve@ResponseStatusmessages with.- Since:
- 5.3.10
 
- 
ServletInvocableHandlerMethodCreate an instance from aHandlerMethod.
 
- 
- 
Method Details- 
setHandlerMethodReturnValueHandlerspublic void setHandlerMethodReturnValueHandlers(HandlerMethodReturnValueHandlerComposite returnValueHandlers) RegisterHandlerMethodReturnValueHandlerinstances to use to handle return values.
- 
invokeAndHandlepublic void invokeAndHandle(ServletWebRequest webRequest, ModelAndViewContainer mavContainer, Object... providedArgs) throws Exception Invoke the method and handle the return value through one of the configuredHandlerMethodReturnValueHandlers.- Parameters:
- webRequest- the current request
- mavContainer- the ModelAndViewContainer for this request
- providedArgs- "given" arguments matched by type (not resolved)
- Throws:
- Exception
 
 
-