From 3cef5a12941b6715fe643e0c6fc1b25848fa4cf4 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Thu, 27 Jul 2017 15:25:35 +0200 Subject: [PATCH] Add RouterFunctions#toWebHandler(RouterFunction) --- .../web/reactive/function/server/RouterFunctions.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java index 141c3a4a3b..029794636c 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java @@ -203,6 +203,16 @@ public abstract class RouterFunctions { .build(); } + /** + * Convert the given {@linkplain RouterFunction router function} into a {@link WebHandler}. + * This conversion uses {@linkplain HandlerStrategies#builder() default strategies}. + * @param routerFunction the router function to convert + * @return a web handler that handles web request using the given router function + */ + public static WebHandler toWebHandler(RouterFunction routerFunction) { + return toWebHandler(routerFunction, HandlerStrategies.withDefaults()); + } + /** * Convert the given {@linkplain RouterFunction router function} into a {@link WebHandler}, * using the given strategies.