类的使用
org.springframework.web.method.HandlerMethod
使用HandlerMethod的程序包 程序包 说明 org.springframework.web.method Common infrastructure for handler method processing, as used by Spring MVC'sorg.springframework.web.servlet.mvc.method
package.org.springframework.web.method.annotation Support classes for annotation-based handler method processing.org.springframework.web.method.support Generic support classes for handler method processing.org.springframework.web.reactive.result.method Infrastructure for handler method processing.org.springframework.web.servlet.handler Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.org.springframework.web.servlet.mvc.method Servlet-based infrastructure for handler method processing, building on theorg.springframework.web.method
package.org.springframework.web.servlet.mvc.method.annotation MVC infrastructure for annotation-based handler method processing, building on theorg.springframework.web.method.annotation
package.org.springframework.web.method中HandlerMethod的使用
返回HandlerMethod的org.springframework.web.method中的方法 修饰符和类型 方法 说明 HandlerMethod
HandlerMethod. createWithResolvedBean()
If the provided instance contains a bean name rather than an object instance, the bean name is resolved before aHandlerMethod
is created and returned.HandlerMethod
HandlerMethod. getResolvedFromHandlerMethod()
Return the HandlerMethod from which this HandlerMethod instance was resolved viacreateWithResolvedBean()
.参数类型为HandlerMethod的org.springframework.web.method中的构造器 构造器 说明 HandlerMethod(HandlerMethod handlerMethod)
Copy constructor for use in subclasses.org.springframework.web.method.annotation中HandlerMethod的使用
参数类型为HandlerMethod的org.springframework.web.method.annotation中的方法 修饰符和类型 方法 说明 void
ModelFactory. initModel(NativeWebRequest request, ModelAndViewContainer container, HandlerMethod handlerMethod)
Populate the model in the following order: Retrieve "known" session attributes listed as@SessionAttributes
.protected boolean
InitBinderDataBinderFactory. isBinderMethodApplicable(HandlerMethod initBinderMethod, WebDataBinder dataBinder)
Determine whether the given@InitBinder
method should be used to initialize the givenWebDataBinder
instance.org.springframework.web.method.support中HandlerMethod的使用
org.springframework.web.method.support中HandlerMethod的子类 修饰符和类型 类 说明 class
InvocableHandlerMethod
Extension ofHandlerMethod
that invokes the underlying method with argument values resolved from the current HTTP request through a list ofHandlerMethodArgumentResolver
.参数类型为HandlerMethod的org.springframework.web.method.support中的构造器 构造器 说明 InvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from aHandlerMethod
.org.springframework.web.reactive.result.method中HandlerMethod的使用
org.springframework.web.reactive.result.method中HandlerMethod的子类 修饰符和类型 类 说明 class
InvocableHandlerMethod
Extension ofHandlerMethod
that invokes the underlying method with argument values resolved from the current HTTP request through a list ofHandlerMethodArgumentResolver
.class
SyncInvocableHandlerMethod
Extension ofHandlerMethod
that invokes the underlying method viaInvocableHandlerMethod
but uses sync argument resolvers only and thus can return directly aHandlerResult
with no async wrappers.返回HandlerMethod的org.springframework.web.reactive.result.method中的方法 修饰符和类型 方法 说明 protected HandlerMethod
AbstractHandlerMethodMapping. createHandlerMethod(Object handler, Method method)
Create the HandlerMethod instance.protected HandlerMethod
AbstractHandlerMethodMapping. handleNoMatch(Set<T> mappings, ServerWebExchange exchange)
Invoked when no matching mapping is not found.protected HandlerMethod
RequestMappingInfoHandlerMapping. handleNoMatch(Set<RequestMappingInfo> infos, ServerWebExchange exchange)
Iterate all RequestMappingInfos once again, look if any match by URL at least and raise exceptions accordingly.protected HandlerMethod
AbstractHandlerMethodMapping. lookupHandlerMethod(ServerWebExchange exchange)
Look up the best-matching handler method for the current request.返回变量类型为HandlerMethod的类型的org.springframework.web.reactive.result.method中的方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<HandlerMethod>
AbstractHandlerMethodMapping. getHandlerInternal(ServerWebExchange exchange)
Look up a handler method for the given request.reactor.core.publisher.Mono<HandlerMethod>
RequestMappingInfoHandlerMapping. getHandlerInternal(ServerWebExchange exchange)
Map<T,HandlerMethod>
AbstractHandlerMethodMapping. getHandlerMethods()
Return a (read-only) map with all mappings and HandlerMethod's.参数类型为HandlerMethod的org.springframework.web.reactive.result.method中的方法 修饰符和类型 方法 说明 protected void
AbstractHandlerMethodMapping. handleMatch(T mapping, HandlerMethod handlerMethod, ServerWebExchange exchange)
Invoked when a matching mapping is found.protected void
RequestMappingInfoHandlerMapping. handleMatch(RequestMappingInfo info, HandlerMethod handlerMethod, ServerWebExchange exchange)
Expose URI template variables, matrix variables, and producible media types in the request.类型变量类型为HandlerMethod的org.springframework.web.reactive.result.method中的方法参数 修饰符和类型 方法 说明 protected void
AbstractHandlerMethodMapping. handlerMethodsInitialized(Map<T,HandlerMethod> handlerMethods)
Invoked after all handler methods have been detected.参数类型为HandlerMethod的org.springframework.web.reactive.result.method中的构造器 构造器 说明 InvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from aHandlerMethod
.SyncInvocableHandlerMethod(HandlerMethod handlerMethod)
org.springframework.web.servlet.handler中HandlerMethod的使用
返回HandlerMethod的org.springframework.web.servlet.handler中的方法 修饰符和类型 方法 说明 protected HandlerMethod
AbstractHandlerMethodMapping. createHandlerMethod(Object handler, Method method)
Create the HandlerMethod instance.protected HandlerMethod
AbstractHandlerMethodMapping. getHandlerInternal(HttpServletRequest request)
Look up a handler method for the given request.protected HandlerMethod
AbstractHandlerMethodMapping. handleNoMatch(Set<T> mappings, String lookupPath, HttpServletRequest request)
Invoked when no matching mapping is not found.protected HandlerMethod
AbstractHandlerMethodMapping. lookupHandlerMethod(String lookupPath, HttpServletRequest request)
Look up the best-matching handler method for the current request.返回变量类型为HandlerMethod的类型的org.springframework.web.servlet.handler中的方法 修饰符和类型 方法 说明 Map<T,HandlerMethod>
AbstractHandlerMethodMapping. getHandlerMethods()
Return a (read-only) map with all mappings and HandlerMethod's.List<HandlerMethod>
AbstractHandlerMethodMapping. getHandlerMethodsForMappingName(String mappingName)
Return the handler methods for the given mapping name.参数类型为HandlerMethod的org.springframework.web.servlet.handler中的方法 修饰符和类型 方法 说明 protected abstract ModelAndView
AbstractHandlerMethodExceptionResolver. doResolveHandlerMethodException(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod, Exception ex)
Actually resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate.String
HandlerMethodMappingNamingStrategy. getName(HandlerMethod handlerMethod, T mapping)
Determine the name for the given HandlerMethod and mapping.类型变量类型为HandlerMethod的org.springframework.web.servlet.handler中的方法参数 修饰符和类型 方法 说明 protected void
AbstractHandlerMethodMapping. handlerMethodsInitialized(Map<T,HandlerMethod> handlerMethods)
Invoked after all handler methods have been detected.org.springframework.web.servlet.mvc.method中HandlerMethod的使用
返回HandlerMethod的org.springframework.web.servlet.mvc.method中的方法 修饰符和类型 方法 说明 protected HandlerMethod
RequestMappingInfoHandlerMapping. getHandlerInternal(HttpServletRequest request)
protected HandlerMethod
RequestMappingInfoHandlerMapping. handleNoMatch(Set<RequestMappingInfo> infos, String lookupPath, HttpServletRequest request)
Iterate all RequestMappingInfo's once again, look if any match by URL at least and raise exceptions according to what doesn't match.参数类型为HandlerMethod的org.springframework.web.servlet.mvc.method中的方法 修饰符和类型 方法 说明 protected abstract long
AbstractHandlerMethodAdapter. getLastModifiedInternal(HttpServletRequest request, HandlerMethod handlerMethod)
Same contract as forHttpServlet.getLastModified(HttpServletRequest)
.String
RequestMappingInfoHandlerMethodMappingNamingStrategy. getName(HandlerMethod handlerMethod, RequestMappingInfo mapping)
protected abstract ModelAndView
AbstractHandlerMethodAdapter. handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod)
Use the given handler method to handle the request.protected abstract boolean
AbstractHandlerMethodAdapter. supportsInternal(HandlerMethod handlerMethod)
Given a handler method, return whether or not this adapter can support it.org.springframework.web.servlet.mvc.method.annotation中HandlerMethod的使用
org.springframework.web.servlet.mvc.method.annotation中HandlerMethod的子类 修饰符和类型 类 说明 class
ServletInvocableHandlerMethod
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.参数类型为HandlerMethod的org.springframework.web.servlet.mvc.method.annotation中的方法 修饰符和类型 方法 说明 protected ServletInvocableHandlerMethod
RequestMappingHandlerAdapter. createInvocableHandlerMethod(HandlerMethod handlerMethod)
Create aServletInvocableHandlerMethod
from the givenHandlerMethod
definition.protected ModelAndView
ExceptionHandlerExceptionResolver. doResolveHandlerMethodException(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod, Exception exception)
Find an@ExceptionHandler
method and invoke it to handle the raised exception.protected ServletInvocableHandlerMethod
ExceptionHandlerExceptionResolver. getExceptionHandlerMethod(HandlerMethod handlerMethod, Exception exception)
Find an@ExceptionHandler
method for the given exception.protected long
RequestMappingHandlerAdapter. getLastModifiedInternal(HttpServletRequest request, HandlerMethod handlerMethod)
This implementation always returns -1.protected ModelAndView
RequestMappingHandlerAdapter. handleInternal(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod)
protected ModelAndView
RequestMappingHandlerAdapter. invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod)
Invoke theRequestMapping
handler method preparing aModelAndView
if view resolution is required.protected boolean
RequestMappingHandlerAdapter. supportsInternal(HandlerMethod handlerMethod)
Always returntrue
since any method argument and return value type will be processed in some way.参数类型为HandlerMethod的org.springframework.web.servlet.mvc.method.annotation中的构造器 构造器 说明 ServletInvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from aHandlerMethod
.