类 HandlerFunctionAdapter

    • 方法详细资料

      • 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 boolean supports​(Object handler)
        从接口复制的说明: HandlerAdapter
        Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

        A typical implementation:

        return (handler instanceof MyHandler);

        指定者:
        supports 在接口中 HandlerAdapter
        参数:
        handler - the handler object to check
        返回:
        whether or not this object can use the given handler
      • handle

        @Nullable
        public ModelAndView handle​(HttpServletRequest servletRequest,
                                   HttpServletResponse servletResponse,
                                   Object handler)
                            throws Exception
        从接口复制的说明: HandlerAdapter
        Use the given handler to handle this request. The workflow that is required may vary widely.
        指定者:
        handle 在接口中 HandlerAdapter
        参数:
        servletRequest - current HTTP request
        servletResponse - current HTTP response
        handler - the handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
        返回:
        a 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