Example usage for org.springframework.web.reactive.function.server HandlerStrategies withDefaults

List of usage examples for org.springframework.web.reactive.function.server HandlerStrategies withDefaults

Introduction

In this page you can find the example usage for org.springframework.web.reactive.function.server HandlerStrategies withDefaults.

Prototype

static HandlerStrategies withDefaults() 

Source Link

Document

Return a new HandlerStrategies with default initialization.

Usage

From source file:org.springframework.web.reactive.function.server.RouterFunctions.java

/**
 * Convert the given {@linkplain RouterFunction router function} into a {@link HttpHandler}.
 * This conversion uses {@linkplain HandlerStrategies#builder() default strategies}.
 * <p>The returned handler can be adapted to run in
 * <ul>/*from  w  w w . j  a v  a2 s . co  m*/
 * <li>Servlet 3.1+ using the
 * {@link org.springframework.http.server.reactive.ServletHttpHandlerAdapter},</li>
 * <li>Reactor using the
 * {@link org.springframework.http.server.reactive.ReactorHttpHandlerAdapter},</li>
 * <li>Undertow using the
 * {@link org.springframework.http.server.reactive.UndertowHttpHandlerAdapter}.</li>
 * </ul>
 * <p>Note that {@code HttpWebHandlerAdapter} also implements {@link WebHandler}, allowing
 * for additional filter and exception handler registration through
 * {@link WebHttpHandlerBuilder}.
 * @param routerFunction the router function to convert
 * @return an http handler that handles HTTP request using the given router function
 */
public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction) {
    return toHttpHandler(routerFunction, HandlerStrategies.withDefaults());
}

From source file:org.springframework.web.reactive.function.server.RouterFunctions.java

/**
 * 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
 *//* w w w.  j a v  a2s. c o m*/
public static WebHandler toWebHandler(RouterFunction<?> routerFunction) {
    return toWebHandler(routerFunction, HandlerStrategies.withDefaults());
}