public class ServerWebExchangeContextFilter extends Object implements WebFilter
Contextthat makes the current
ServerWebExchangeavailable under the attribute name
EXCHANGE_CONTEXT_ATTRIBUTE. This is useful for access to the exchange without explicitly passing it to components that participate in request processing.
The convenience method
get(Context) looks up the exchange.
|Modifier and Type||Field and Description|
Attribute name under which the exchange is saved in the context.
|Constructor and Description|
|Modifier and Type||Method and Description|
Process the Web request and (optionally) delegate to the next
public static final String EXCHANGE_CONTEXT_ATTRIBUTE
public reactor.core.publisher.Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain)
WebFilterthrough the given
public static Optional<ServerWebExchange> get(reactor.util.context.Context context)
ServerWebExchangefrom the Reactor Context, if available, which is if
ServerWebExchangeContextFilteris configured for use and the give context was obtained from a request processing chain.
context- the context in which to access the exchange