org.springframework.web.servlet.mvc.method.annotation

Class ServletInvocableHandlerMethod



  • public class ServletInvocableHandlerMethod
    extends InvocableHandlerMethod
    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
    • Constructor Detail

      • ServletInvocableHandlerMethod

        public ServletInvocableHandlerMethod(java.lang.Object handler,
                                             java.lang.reflect.Method method)
        Creates an instance from the given handler and method.
      • ServletInvocableHandlerMethod

        public ServletInvocableHandlerMethod(HandlerMethod handlerMethod)
        Create an instance from a HandlerMethod.
    • Method Detail

      • invokeAndHandle

        public void invokeAndHandle(ServletWebRequest webRequest,
                                    ModelAndViewContainer mavContainer,
                                    java.lang.Object... providedArgs)
                             throws java.lang.Exception
        Invoke the method and handle the return value through one of the configured HandlerMethodReturnValueHandlers.
        Parameters:
        webRequest - the current request
        mavContainer - the ModelAndViewContainer for this request
        providedArgs - "given" arguments matched by type (not resolved)
        Throws:
        java.lang.Exception