Class AbstractHandlerMapping

    • Constructor Detail

      • AbstractHandlerMapping

        public AbstractHandlerMapping()
    • Method Detail

      • setUseCaseSensitiveMatch

        public void setUseCaseSensitiveMatch(boolean caseSensitiveMatch)
        Shortcut method for setting the same property on the underlying pattern parser in use. For more details see:

        Note: aside from

      • setCorsConfigurations

        public void setCorsConfigurations(java.util.Map<java.lang.String,CorsConfiguration> corsConfigurations)
        Set the "global" CORS configurations based on URL patterns. By default the first matching URL pattern is combined with handler-level CORS configuration if any.
        See Also:
      • setCorsConfigurationSource

        public void setCorsConfigurationSource(CorsConfigurationSource corsConfigurationSource)
        Set the "global" CORS configuration source. By default the first matching URL pattern is combined with the CORS configuration for the handler, if any.
        See Also:
      • setOrder

        public void setOrder(int order)
        Specify the order value for this HandlerMapping bean.

        The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.

        See Also:
      • getOrder

        public int getOrder()
        Description copied from interface: 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.

        Specified by:
        getOrder in interface Ordered
        the order value
        See Also:
      • setBeanName

        public void setBeanName(java.lang.String name)
        Description copied from interface: BeanNameAware
        Set the name of the bean in the bean factory that created this bean.

        Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method.

        Specified by:
        setBeanName in interface BeanNameAware
        name - the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String) method to extract the original bean name (without suffix), if desired.
      • formatMappingName

        protected java.lang.String formatMappingName()
      • getHandler

        public reactor.core.publisher.Mono<java.lang.Object> getHandler(ServerWebExchange exchange)
        Description copied from interface: HandlerMapping
        Return a handler for this request.
        Specified by:
        getHandler in interface HandlerMapping
        exchange - current server exchange
        a Mono that emits one value or none in case the request cannot be resolved to a handler
      • getHandlerInternal

        protected abstract reactor.core.publisher.Mono<?> getHandlerInternal(ServerWebExchange exchange)
        Look up a handler for the given request, returning an empty Mono if no specific one is found. This method is called by getHandler(org.springframework.web.server.ServerWebExchange).

        On CORS pre-flight requests this method should return a match not for the pre-flight request but for the expected actual request based on the URL path, the HTTP methods from the "Access-Control-Request-Method" header, and the headers from the "Access-Control-Request-Headers" header.

        exchange - current exchange
        Mono for the matching handler, if any
      • getCorsConfiguration

        protected CorsConfiguration getCorsConfiguration(java.lang.Object handler,
                                                                   ServerWebExchange exchange)
        Retrieve the CORS configuration for the given handler.
        handler - the handler to check (never null)
        exchange - the current exchange
        the CORS configuration for the handler, or null if none