接口的使用
org.springframework.web.server.WebFilter
使用WebFilter的程序包 程序包 说明 org.springframework.test.web.reactive.server Support for testing Spring WebFlux server endpoints viaWebTestClient
.org.springframework.web.cors.reactive Reactive support for CORS (Cross-Origin Resource Sharing), based on a commonCorsProcessor
strategy.org.springframework.web.filter.reactive WebFilter
implementations for use in reactive web applications.org.springframework.web.reactive.function.server Provides the types that make up Spring's functional web framework for Reactive environments.org.springframework.web.server.adapter Implementations to adapt to the underlyingorg.springframework.http.client.reactive
reactive HTTP adapter andHttpHandler
.org.springframework.web.server.handler Provides common WebHandler implementations and aWebHandlerDecorator
.org.springframework.test.web.reactive.server中WebFilter的使用
org.springframework.web.cors.reactive中WebFilter的使用
实现WebFilter的org.springframework.web.cors.reactive中的类 修饰符和类型 类 说明 class
CorsWebFilter
WebFilter
that handles CORS preflight requests and intercepts CORS simple and actual requests thanks to aCorsProcessor
implementation (DefaultCorsProcessor
by default) in order to add the relevant CORS response headers (likeAccess-Control-Allow-Origin
) using the providedCorsConfigurationSource
(for example anUrlBasedCorsConfigurationSource
instance.org.springframework.web.filter.reactive中WebFilter的使用
实现WebFilter的org.springframework.web.filter.reactive中的类 修饰符和类型 类 说明 class
ForwardedHeaderFilter
已过时。as of 5.1 this filter is deprecated in favor of usingForwardedHeaderTransformer
which can be declared as a bean with the name "forwardedHeaderTransformer" or registered explicitly inWebHttpHandlerBuilder
.class
HiddenHttpMethodFilter
ReactiveWebFilter
that converts posted method parameters into HTTP methods, retrievable viaHttpRequest.getMethod()
.class
ServerWebExchangeContextFilter
Inserts an attribute in the ReactorContext
that makes the currentServerWebExchange
available under the attribute nameServerWebExchangeContextFilter.EXCHANGE_CONTEXT_ATTRIBUTE
.org.springframework.web.reactive.function.server中WebFilter的使用
返回变量类型为WebFilter的类型的org.springframework.web.reactive.function.server中的方法 修饰符和类型 方法 说明 List<WebFilter>
HandlerStrategies. webFilters()
Return theWebFilters
to be used for filtering the request and response.参数类型为WebFilter的org.springframework.web.reactive.function.server中的方法 修饰符和类型 方法 说明 HandlerStrategies.Builder
HandlerStrategies.Builder. webFilter(WebFilter filter)
Add the given web filter to this builder.org.springframework.web.server.adapter中WebFilter的使用
参数类型为WebFilter的org.springframework.web.server.adapter中的方法 修饰符和类型 方法 说明 WebHttpHandlerBuilder
WebHttpHandlerBuilder. filter(WebFilter... filters)
Add the given filter(s).类型变量类型为WebFilter的org.springframework.web.server.adapter中的方法参数 修饰符和类型 方法 说明 WebHttpHandlerBuilder
WebHttpHandlerBuilder. filters(Consumer<List<WebFilter>> consumer)
Manipulate the "live" list of currently configured filters.org.springframework.web.server.handler中WebFilter的使用
返回变量类型为WebFilter的类型的org.springframework.web.server.handler中的方法 修饰符和类型 方法 说明 List<WebFilter>
DefaultWebFilterChain. getFilters()
List<WebFilter>
FilteringWebHandler. getFilters()
Return a read-only list of the configured filters.参数类型为WebFilter的org.springframework.web.server.handler中的构造器 构造器 说明 DefaultWebFilterChain(WebHandler handler, WebFilter... filters)
已过时。as of 5.1 this constructor is deprecated in favor ofDefaultWebFilterChain(WebHandler, List)
.类型变量类型为WebFilter的org.springframework.web.server.handler中的构造器参数 构造器 说明 DefaultWebFilterChain(WebHandler handler, List<WebFilter> filters)
Public constructor with the list of filters and the target handler to use.FilteringWebHandler(WebHandler handler, List<WebFilter> filters)
Constructor.