Skip to content

Commit 3cef5a1

Browse files
committed
Add RouterFunctions#toWebHandler(RouterFunction<?>)
1 parent eb435f5 commit 3cef5a1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@ public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, Handle
203203
.build();
204204
}
205205

206+
/**
207+
* Convert the given {@linkplain RouterFunction router function} into a {@link WebHandler}.
208+
* This conversion uses {@linkplain HandlerStrategies#builder() default strategies}.
209+
* @param routerFunction the router function to convert
210+
* @return a web handler that handles web request using the given router function
211+
*/
212+
public static WebHandler toWebHandler(RouterFunction<?> routerFunction) {
213+
return toWebHandler(routerFunction, HandlerStrategies.withDefaults());
214+
}
215+
206216
/**
207217
* Convert the given {@linkplain RouterFunction router function} into a {@link WebHandler},
208218
* using the given strategies.

0 commit comments

Comments
 (0)