类 EndpointHandlerMapping

  • 所有已实现的接口:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.EmbeddedValueResolverAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.handler.MatchableHandlerMapping, org.springframework.web.servlet.HandlerMapping

    public class EndpointHandlerMapping
    extends AbstractEndpointHandlerMapping<MvcEndpoint>
    HandlerMapping to map Endpoints to URLs via Endpoint.getId(). The semantics of @RequestMapping should be identical to a normal @Controller, but the endpoints should not be annotated as @Controller (otherwise they will be mapped by the normal MVC mechanisms).

    One of the aims of the mapping is to support endpoints that work as HTTP endpoints but can still provide useful service interfaces when there is no HTTP server (and no Spring MVC on the classpath). Note that any endpoints having method signatures will break in a non-servlet environment.

    • 字段概要

      • 从类继承的字段 org.springframework.context.support.ApplicationObjectSupport

        logger
      • 从接口继承的字段 org.springframework.web.servlet.HandlerMapping

        BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
      • 从接口继承的字段 org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • 方法概要

      • 从类继承的方法 org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping

        createRequestMappingInfo, getContentNegotiationManager, getCustomMethodCondition, getCustomTypeCondition, getFileExtensions, getMappingForMethod, match, resolveEmbeddedValuesInPatterns, setContentNegotiationManager, setEmbeddedValueResolver, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, useRegisteredSuffixPatternMatch, useSuffixPatternMatch, useTrailingSlashMatch
      • 从类继承的方法 org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping

        getMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatch, handleNoMatch
      • 从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMethodMapping

        createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, getNamingStrategy, handlerMethodsInitialized, initHandlerMethods, lookupHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, unregisterMapping
      • 从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMapping

        adaptInterceptor, detectMappedInterceptors, getAdaptedInterceptors, getCorsConfigurations, getCorsProcessor, getDefaultHandler, getHandler, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
      • 从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • 从类继承的方法 org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
      • 从接口继承的方法 org.springframework.web.servlet.HandlerMapping

        getHandler
    • 构造器详细资料

      • EndpointHandlerMapping

        public EndpointHandlerMapping​(Collection<? extends MvcEndpoint> endpoints,
                                      org.springframework.web.cors.CorsConfiguration corsConfiguration)
        Create a new EndpointHandlerMapping instance. All Endpoints will be detected from the ApplicationContext. The endpoints will accepts CORS requests based on the given corsConfiguration.
        参数:
        endpoints - the endpoints
        corsConfiguration - the CORS configuration for the endpoints
        从以下版本开始:
        1.3.0