Uses of Interface
org.springframework.web.servlet.function.ServerResponse
Package
Description
Provides the types that make up Spring's functional web framework for Servlet environments.
-
Uses of ServerResponse in org.springframework.web.servlet.function
Modifier and TypeInterfaceDescriptioninterface
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.Modifier and TypeInterfaceDescriptioninterface
Asynchronous subtype ofServerResponse
that exposes the future response.interface
Entity-specific subtype ofServerResponse
that exposes entity data.interface
Rendering-specific subtype ofServerResponse
that exposes model and template data.Modifier and TypeMethodDescriptionstatic <T extends ServerResponse>
RouterFunction<T>RouterFunctions.changeParser
(RouterFunction<T> routerFunction, PathPatternParser parser) Changes thePathPatternParser
on the given router function.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>
HandlerFilterFunction<T,T> HandlerFilterFunction.ofErrorHandler
(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, T> errorHandler) Adapt the given predicate and response provider function to a filter function that returns aServerResponse
on a given exception.static <T extends ServerResponse>
HandlerFilterFunction<T,T> HandlerFilterFunction.ofRequestProcessor
(Function<ServerRequest, ServerRequest> requestProcessor) Adapt the given request processor function to a filter function that only operates on theServerRequest
.static <T extends ServerResponse,
R extends ServerResponse>
HandlerFilterFunction<T,R> HandlerFilterFunction.ofResponseProcessor
(BiFunction<ServerRequest, T, 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
(BiFunction<ServerRequest, T, 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.Modifier and TypeMethodDescriptionstatic ServerResponse
Create a (built) response with the given asynchronous response.static ServerResponse
Create a (built) response with the given asynchronous response.AsyncServerResponse.block()
Blocks indefinitely until the future response is obtained.Set the body of the response to the givenObject
and return it.<T> ServerResponse
ServerResponse.BodyBuilder.body
(T body, ParameterizedTypeReference<T> bodyType) Set the body of the response to the givenObject
and return it.ServerResponse.HeadersBuilder.build()
Build the response entity with no body.ServerResponse.HeadersBuilder.build
(BiFunction<HttpServletRequest, HttpServletResponse, ModelAndView> writeFunction) Build the response entity with a custom write function.Render the template with the givenname
using the givenmodelAttributes
.Render the template with the givenname
using the givenmodel
.static ServerResponse
ServerResponse.sse
(Consumer<ServerResponse.SseBuilder> consumer) Create a server-sent event response.static ServerResponse
ServerResponse.sse
(Consumer<ServerResponse.SseBuilder> consumer, Duration timeout) Create a server-sent event response.Modifier and TypeMethodDescriptionRouterFunctions.Builder.build()
Builds theRouterFunction
.default Optional<ServerResponse>
ServerRequest.checkNotModified
(String etag) Check whether the requested resource has been modified given the suppliedETag
(entity tag), as determined by the application.default Optional<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 Optional<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.static RouterFunction<ServerResponse>
Route requests that match the given pattern to resources relative to the given root location.static RouterFunction<ServerResponse>
RouterFunctions.resources
(Function<ServerRequest, Optional<Resource>> lookupFunction) Route to resources using the provided lookup function.Modifier and TypeMethodDescriptionstatic ServerResponse.BodyBuilder
ServerResponse.from
(ServerResponse other) Create a builder with the status code and headers of the given response.Modifier and TypeMethodDescriptionRouterFunctions.Builder.add
(RouterFunction<ServerResponse> routerFunction) Adds the given route to this 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.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.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.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.DELETE
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPDELETE
requests.RouterFunctions.Builder.DELETE
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPDELETE
requests that match the given predicate.RouterFunctions.Builder.filter
(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) Filters all routes created by this builder with the given filter function.RouterFunctions.Builder.filter
(HandlerFilterFunction<ServerResponse, ServerResponse> filterFunction) Filters all routes created by this builder with the given filter function.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.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.GET
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPGET
requests.RouterFunctions.Builder.GET
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPGET
requests that match the given predicate.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.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.HEAD
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPHEAD
requests.RouterFunctions.Builder.HEAD
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPHEAD
requests that match the given predicate.RouterFunctions.Builder.nest
(RequestPredicate predicate, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) Route to the supplied router function if the given request predicate applies.RouterFunctions.Builder.onError
(Class<? extends Throwable> exceptionType, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) Filters all exceptions of the given type by applying the given response provider function.RouterFunctions.Builder.onError
(Predicate<Throwable> predicate, BiFunction<Throwable, ServerRequest, ServerResponse> responseProvider) Filters all exceptions that match the predicate by applying the given response provider function.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.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.OPTIONS
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPOPTIONS
requests.RouterFunctions.Builder.OPTIONS
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPOPTIONS
requests that match the given predicate.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.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.PATCH
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPATCH
requests.RouterFunctions.Builder.PATCH
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPATCH
requests that match the given predicate.RouterFunctions.Builder.path
(String pattern, Supplier<RouterFunction<ServerResponse>> routerFunctionSupplier) Route to the supplied router function if the given path prefix pattern applies.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.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.POST
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPOST
requests.RouterFunctions.Builder.POST
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPOST
requests that match the given predicate.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.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.PUT
(HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles HTTPPUT
requests.RouterFunctions.Builder.PUT
(RequestPredicate predicate, HandlerFunction<ServerResponse> handlerFunction) Adds a route to the given handler function that handles all HTTPPUT
requests that match the given predicate.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.