接口的使用
org.springframework.web.reactive.function.server.ServerResponse
使用ServerResponse的程序包 程序包 说明 org.springframework.web.reactive.function.server Provides the types that make up Spring's functional web framework for Reactive environments.org.springframework.web.reactive.function.server中ServerResponse的使用
类型参数类型为ServerResponse的org.springframework.web.reactive.function.server中的类 修饰符和类型 接口 说明 interface
HandlerFilterFunction<T extends ServerResponse,R extends ServerResponse>
Represents a function that filters a handler function.interface
HandlerFilterFunction<T extends ServerResponse,R extends ServerResponse>
Represents a function that filters a handler function.interface
HandlerFunction<T extends ServerResponse>
Represents a function that handles a request.interface
RouterFunction<T extends ServerResponse>
Represents a function that routes to a handler function.org.springframework.web.reactive.function.server中ServerResponse的子接口 修饰符和类型 接口 说明 interface
EntityResponse<T>
Entity-specific subtype ofServerResponse
that exposes entity data.interface
RenderingResponse
Rendering-specific subtype ofServerResponse
that exposes model and template data.类型参数类型为ServerResponse的org.springframework.web.reactive.function.server中的方法 修饰符和类型 方法 说明 default <S extends ServerResponse>
RouterFunction<S>RouterFunction. filter(HandlerFilterFunction<T,S> filterFunction)
Filter all handler functions routed by this function with the given filter function.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions. nest(RequestPredicate predicate, RouterFunction<T> routerFunction)
Route to the given router function if the given request predicate applies.static <T extends ServerResponse,R extends ServerResponse>
HandlerFilterFunction<T,R>HandlerFilterFunction. ofResponseProcessor(Function<T,reactor.core.publisher.Mono<R>> responseProcessor)
Adapt the given response processor function to a filter function that only operates on theServerResponse
.static <T extends ServerResponse,R extends ServerResponse>
HandlerFilterFunction<T,R>HandlerFilterFunction. ofResponseProcessor(Function<T,reactor.core.publisher.Mono<R>> responseProcessor)
Adapt the given response processor function to a filter function that only operates on theServerResponse
.static <T extends ServerResponse>
RouterFunction<T>RouterFunctions. route(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
Route to the given handler function if the given request predicate applies.返回变量类型为ServerResponse的类型的org.springframework.web.reactive.function.server中的方法 修饰符和类型 方法 说明 reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. body(Object producer, Class<?> elementClass)
Variant ofServerResponse.BodyBuilder.body(Publisher, Class)
that allows using any producer that can be resolved toPublisher
viaReactiveAdapterRegistry
.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. body(Object producer, ParameterizedTypeReference<?> elementTypeRef)
Variant ofServerResponse.BodyBuilder.body(Publisher, ParameterizedTypeReference)
that allows using any producer that can be resolved toPublisher
viaReactiveAdapterRegistry
.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. body(BodyInserter<?,? super ServerHttpResponse> inserter)
Set the body of the response to the givenBodyInserter
and return it.<T,P extends org.reactivestreams.Publisher<T>>
reactor.core.publisher.Mono<ServerResponse>ServerResponse.BodyBuilder. body(P publisher, Class<T> elementClass)
Set the body from the givenPublisher
.<T,P extends org.reactivestreams.Publisher<T>>
reactor.core.publisher.Mono<ServerResponse>ServerResponse.BodyBuilder. body(P publisher, ParameterizedTypeReference<T> elementTypeRef)
Variant ofServerResponse.BodyBuilder.body(Publisher, Class)
that allows using any producer that can be resolved toPublisher
viaReactiveAdapterRegistry
.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. bodyValue(Object body)
Set the body of the response to the givenObject
and return it.RouterFunction<ServerResponse>
RouterFunctions.Builder. build()
Builds theRouterFunction
.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.HeadersBuilder. build()
Build the response entity with no body.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.HeadersBuilder. build(BiFunction<ServerWebExchange,ServerResponse.Context,reactor.core.publisher.Mono<Void>> writeFunction)
Build the response entity with a custom writer function.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.HeadersBuilder. build(org.reactivestreams.Publisher<Void> voidPublisher)
Build the response entity with no body.default reactor.core.publisher.Mono<ServerResponse>
ServerRequest. checkNotModified(String etag)
Check whether the requested resource has been modified given the suppliedETag
(entity tag), as determined by the application.default reactor.core.publisher.Mono<ServerResponse>
ServerRequest. checkNotModified(Instant lastModified)
Check whether the requested resource has been modified given the supplied last-modified timestamp (as determined by the application).default reactor.core.publisher.Mono<ServerResponse>
ServerRequest. checkNotModified(Instant lastModified, String etag)
Check whether the requested resource has been modified given the suppliedETag
(entity tag) and last-modified timestamp, as determined by the application.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. render(String name, Object... modelAttributes)
Render the template with the givenname
using the givenmodelAttributes
.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. render(String name, Map<String,?> model)
Render the template with the givenname
using the givenmodel
.static RouterFunction<ServerResponse>
RouterFunctions. resources(String pattern, Resource location)
Route requests that match the given pattern to resources relative to the given root location.static RouterFunction<ServerResponse>
RouterFunctions. resources(Function<ServerRequest,reactor.core.publisher.Mono<Resource>> lookupFunction)
Route to resources using the provided lookup function.reactor.core.publisher.Mono<ServerResponse>
ServerResponse.BodyBuilder. syncBody(Object body)
已过时。as of Spring Framework 5.2 in favor ofServerResponse.BodyBuilder.bodyValue(Object)
参数类型为ServerResponse的org.springframework.web.reactive.function.server中的方法 修饰符和类型 方法 说明 static ServerResponse.BodyBuilder
ServerResponse. from(ServerResponse other)
Create a builder with the status code and headers of the given response.类型变量类型为ServerResponse的org.springframework.web.reactive.function.server中的方法参数 修饰符和类型 方法 说明 RouterFunctions.Builder
RouterFunctions.Builder. add(RouterFunction<ServerResponse> routerFunction)
Adds the given route to this builder.RouterFunctions.Builder
RouterFunctions.Builder. after(BiFunction<ServerRequest,ServerResponse,ServerResponse> responseProcessor)
Filter the response object for all routes created by this builder with the given response processing function.RouterFunctions.Builder
RouterFunctions.Builder. after(BiFunction<ServerRequest,ServerResponse,ServerResponse> responseProcessor)
Filter the response object for all routes created by this builder with the given response processing function.RouterFunctions.Builder
RouterFunctions.Builder. DELETE(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPDELETE
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. DELETE(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPDELETE
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. filter(HandlerFilterFunction<ServerResponse,ServerResponse> filterFunction)
Filters all routes created by this builder with the given filter function.RouterFunctions.Builder
RouterFunctions.Builder. filter(HandlerFilterFunction<ServerResponse,ServerResponse> filterFunction)
Filters all routes created by this builder with the given filter function.RouterFunctions.Builder
RouterFunctions.Builder. GET(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPGET
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. GET(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPGET
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. HEAD(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPHEAD
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. HEAD(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPHEAD
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. nest(RequestPredicate predicate, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier)
Route to the supplied router function if the given request predicate applies.<T extends Throwable>
RouterFunctions.BuilderRouterFunctions.Builder. onError(Class<T> exceptionType, BiFunction<? super T,ServerRequest,reactor.core.publisher.Mono<ServerResponse>> responseProvider)
Filters all exceptions of the given type by applying the given response provider function.RouterFunctions.Builder
RouterFunctions.Builder. onError(Predicate<? super Throwable> predicate, BiFunction<? super Throwable,ServerRequest,reactor.core.publisher.Mono<ServerResponse>> responseProvider)
Filters all exceptions that match the predicate by applying the given response provider function.RouterFunctions.Builder
RouterFunctions.Builder. OPTIONS(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPOPTIONS
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. OPTIONS(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPOPTIONS
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. PATCH(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPATCH
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. PATCH(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPATCH
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. path(String pattern, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier)
Route to the supplied router function if the given path prefix pattern applies.RouterFunctions.Builder
RouterFunctions.Builder. POST(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPOST
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. POST(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPOST
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. PUT(String pattern, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPUT
requests that match the given pattern.RouterFunctions.Builder
RouterFunctions.Builder. PUT(String pattern, RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all HTTPPUT
requests that match the given pattern and predicate.RouterFunctions.Builder
RouterFunctions.Builder. route(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction)
Adds a route to the given handler function that handles all requests that match the given predicate.