类 SimpleUrlHandlerMapping
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.reactive.handler.AbstractHandlerMapping
- org.springframework.web.reactive.handler.AbstractUrlHandlerMapping
- org.springframework.web.reactive.handler.SimpleUrlHandlerMapping
- 所有已实现的接口:
Aware,BeanNameAware,ApplicationContextAware,Ordered,HandlerMapping
public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping
Implementation of theHandlerMappinginterface to map from URLs to request handler beans. Supports both mapping to bean instances and mapping to bean names; the latter is required for non-singleton handlers.The "urlMap" property is suitable for populating the handler map with bean instances. Mappings to bean names can be set via the "mappings" property, in a form accepted by the
java.util.Propertiesclass, as follows:/welcome.html=ticketController /show.html=ticketController
The syntax is
PATH=HANDLER_BEAN_NAME. If the path doesn't begin with a slash, one is prepended.Supports direct matches, e.g. a registered "/test" matches "/test", and various Ant-style pattern matches, e.g. a registered "/t*" pattern matches both "/test" and "/team", "/test/*" matches all paths under "/test", "/test/**" matches all paths below "/test". For details, see the
PathPatternjavadoc.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Sam Brannen
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.web.reactive.HandlerMapping
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 SimpleUrlHandlerMapping()Create aSimpleUrlHandlerMappingwith default settings.SimpleUrlHandlerMapping(Map<String,?> urlMap)Create aSimpleUrlHandlerMappingusing the supplied URL map.SimpleUrlHandlerMapping(Map<String,?> urlMap, int order)Create aSimpleUrlHandlerMappingusing the supplied URL map and order.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Map<String,?>getUrlMap()Allow Map access to the URL path mappings, with the option to add or override specific entries.voidinitApplicationContext()Calls theregisterHandlers(java.util.Map<java.lang.String, java.lang.Object>)method in addition to the superclass's initialization.protected voidregisterHandlers(Map<String,Object> urlMap)Register all handlers specified in the URL map for the corresponding paths.voidsetMappings(Properties mappings)Map URL paths to handler bean names.voidsetUrlMap(Map<String,?> urlMap)Set a Map with URL paths as keys and handler beans (or handler bean names) as values.从类继承的方法 org.springframework.web.reactive.handler.AbstractUrlHandlerMapping
getHandlerInternal, getHandlerMap, lookupHandler, registerHandler, registerHandler, setLazyInitHandlers, validateHandler
从类继承的方法 org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getCorsConfiguration, getCorsProcessor, getHandler, getOrder, getPathPatternParser, hasCorsConfigurationSource, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
SimpleUrlHandlerMapping
public SimpleUrlHandlerMapping()
Create aSimpleUrlHandlerMappingwith default settings.
SimpleUrlHandlerMapping
public SimpleUrlHandlerMapping(Map<String,?> urlMap)
Create aSimpleUrlHandlerMappingusing the supplied URL map.- 参数:
urlMap- map with URL paths as keys and han