Set PathPatternParser in RouterFunctionMapping

See gh-24945
This commit is contained in:
Rossen Stoyanchev
2020-06-23 15:18:25 +01:00
parent 734f4a4706
commit 837dfe285a
2 changed files with 32 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.RouterFunctions;
import org.springframework.web.servlet.function.ServerRequest;
import org.springframework.web.servlet.handler.AbstractHandlerMapping;
import org.springframework.web.util.pattern.PathPatternParser;
/**
* {@code HandlerMapping} implementation that supports {@link RouterFunction RouterFunctions}.
@@ -76,6 +77,9 @@ public class RouterFunctionMapping extends AbstractHandlerMapping implements Ini
* {@link RouterFunction} instances available in the application context.
*/
public RouterFunctionMapping() {
// gh-23236 will ensure the configured parser is used to parse patterns
// For now this helps to signal to the DispatcherServlet the need to initialize the RequestPath
setPatternParser(new PathPatternParser());
}
/**