public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMapping
RequestMappingInfo instances from type and method-level
@RequestMapping annotations in
@Controller classes.BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE| Constructor and Description |
|---|
RequestMappingHandlerMapping() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
getContentNegotiationFileExtensions()
Return the known file extensions for content negotiation.
|
org.springframework.web.accept.ContentNegotiationManager |
getContentNegotiationManager()
Return the configured
ContentNegotiationManager. |
protected RequestCondition<?> |
getCustomMethodCondition(java.lang.reflect.Method method)
Provide a custom method-level request condition.
|
protected RequestCondition<?> |
getCustomTypeCondition(java.lang.Class<?> handlerType)
Provide a custom type-level request condition.
|
protected RequestMappingInfo |
getMappingForMethod(java.lang.reflect.Method method,
java.lang.Class<?> handlerType)
Uses method and type-level @
RequestMapping annotations to create
the RequestMappingInfo. |
protected boolean |
isHandler(java.lang.Class<?> beanType)
Whether the given type is a handler with handler methods.
|
void |
setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)
Set the
ContentNegotiationManager to use to determine requested media types. |
void |
setUseSuffixPatternMatch(boolean useSuffixPatternMatch)
Whether to use suffix pattern match (".*") when matching patterns to
requests.
|
void |
setUseTrailingSlashMatch(boolean useTrailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
|
boolean |
useSuffixPatternMatch()
Whether to use suffix pattern matching.
|
boolean |
useTrailingSlashMatch()
Whether to match to URLs irrespective of the presence of a trailing slash.
|
getMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatch, handleNoMatchafterPropertiesSet, detectHandlerMethods, getHandlerInternal, getHandlerMethods, handlerMethodsInitialized, initHandlerMethods, lookupHandlerMethod, registerHandlerMethod, setDetectHandlerMethodsInAncestorContextsadaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelpergetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic void setUseSuffixPatternMatch(boolean useSuffixPatternMatch)
The default value is true.
public void setUseTrailingSlashMatch(boolean useTrailingSlashMatch)
The default value is true.
public void setContentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager contentNegotiationManager)
ContentNegotiationManager to use to determine requested media types.
If not set, the default constructor is used.public boolean useSuffixPatternMatch()
public boolean useTrailingSlashMatch()
public org.springframework.web.accept.ContentNegotiationManager getContentNegotiationManager()
ContentNegotiationManager.public java.util.List<java.lang.String> getContentNegotiationFileExtensions()
protected boolean isHandler(java.lang.Class<?> beanType)
Controller annotation.isHandler in class AbstractHandlerMethodMapping<RequestMappingInfo>beanType - the type of the bean being checkedprotected RequestMappingInfo getMappingForMethod(java.lang.reflect.Method method, java.lang.Class<?> handlerType)
RequestMapping annotations to create
the RequestMappingInfo.getMappingForMethod in class AbstractHandlerMethodMapping<RequestMappingInfo>method - the method to provide a mapping forhandlerType - the handler type, possibly a sub-type of the method's
declaring classnull if the method
does not have a @RequestMapping annotation.getCustomMethodCondition(Method),
getCustomTypeCondition(Class)protected RequestCondition<?> getCustomTypeCondition(java.lang.Class<?> handlerType)
RequestCondition can be of any type so long as the
same condition type is returned from all calls to this method in order
to ensure custom request conditions can be combined and compared.
Consider extending AbstractRequestCondition for custom
condition types and using CompositeRequestCondition to provide
multiple custom conditions.
handlerType - the handler type for which to create the conditionnullprotected RequestCondition<?> getCustomMethodCondition(java.lang.reflect.Method method)
RequestCondition can be of any type so long as the
same condition type is returned from all calls to this method in order
to ensure custom request conditions can be combined and compared.
Consider extending AbstractRequestCondition for custom
condition types and using CompositeRequestCondition to provide
multiple custom conditions.
method - the handler method for which to create the conditionnull