diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
index 198f4492ed..ae6ce3e62d 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java
@@ -121,14 +121,14 @@ import org.springframework.web.util.pattern.PathPatternParser;
*
*
This class registers the following {@link HandlerMapping HandlerMappings}:
*
+ * - {@link RouterFunctionMapping}
+ * ordered at -1 to map {@linkplain org.springframework.web.servlet.function.RouterFunction router functions}.
*
- {@link RequestMappingHandlerMapping}
* ordered at 0 for mapping requests to annotated controller methods.
*
- {@link HandlerMapping}
* ordered at 1 to map URL paths directly to view names.
*
- {@link BeanNameUrlHandlerMapping}
* ordered at 2 to map URL paths to controller bean names.
- *
- {@link RouterFunctionMapping}
- * ordered at 3 to map {@linkplain org.springframework.web.servlet.function.RouterFunction router functions}.
*
- {@link HandlerMapping}
* ordered at {@code Integer.MAX_VALUE-1} to serve static resource requests.
*
- {@link HandlerMapping}
@@ -535,7 +535,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
}
/**
- * Return a {@link RouterFunctionMapping} ordered at 3 to map
+ * Return a {@link RouterFunctionMapping} ordered at -1 to map
* {@linkplain org.springframework.web.servlet.function.RouterFunction router functions}.
* Consider overriding one of these other more fine-grained methods:
*
@@ -552,7 +552,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
@Qualifier("mvcResourceUrlProvider") ResourceUrlProvider resourceUrlProvider) {
RouterFunctionMapping mapping = new RouterFunctionMapping();
- mapping.setOrder(3);
+ mapping.setOrder(-1); // go before RequestMappingHandlerMapping
mapping.setInterceptors(getInterceptors(conversionService, resourceUrlProvider));
mapping.setCorsConfigurations(getCorsConfigurations());
mapping.setMessageConverters(getMessageConverters());