ServerResponse.BodyBuilder implementation.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final MultiValueMap | |
| private final HttpHeaders | |
| private final HttpStatusCode |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ServerResponse. | allow(HttpMethod...
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public ServerResponse. | allow(Set<HttpMethod>
the allowed methods allowedMethods)Implements org. Set the set of allowed |
| public ServerResponse | body(Object
the body of the response body)Implements org. Set the body of the response to the given |
| public <T> ServerResponse | body(T
the body of the response body, ParameterizedTypeReference<T> the type of the body, used to capture the generic type bodyType)Implements org. Set the body of the response to the given |
| public ServerResponse | build()
Implements org. Build the response entity with no body. |
| public ServerResponse | build(ServerResponse.
the function used to write to the writeFunctionHttpServletResponseImplements org. Build the response entity with a custom write function. |
| public ServerResponse. | cacheControl(CacheControl
a builder for cache-related HTTP response headers cacheControl)Implements org. Set the caching directives for the resource, as specified by the HTTP 1.1
|
| public ServerResponse. | contentLength(long
the content length contentLength)Implements org. Set the length of the body in bytes, as specified by the
|
| public ServerResponse. | contentType(MediaType
the content type contentType)Implements org. Set the media type of the body, as specified by the
|
| public ServerResponse. | cookie(Cookie
the cookie to add cookie)Implements org. Add the given cookie to the response. |
| public ServerResponse. | cookies(Consumer<MultiValueMap<String, Cookie>>
a function that consumes the cookies cookiesConsumer)Implements org. Manipulate this response's cookies with the given consumer. |
| public ServerResponse. | eTag(String
the new entity tag etag)Implements org. Set the entity tag of the body, as specified by the |
| public ServerResponse. | header(String
the header name headerName, String... the header value(s) headerValues)Implements org. Add the given header value(s) under the given name. |
| public ServerResponse. | headers(Consumer<HttpHeaders>
a function that consumes the headersConsumer)HttpHeadersImplements org. Manipulate this response's headers with the given consumer. |
| public ServerResponse. | lastModified(ZonedDateTime
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public ServerResponse. | lastModified(Instant
the last modified date lastModified)Implements org. Set the time the resource was last changed, as specified by the
|
| public ServerResponse. | location(URI
the location location)Implements org. Set the location of a resource, as specified by the |
| public ServerResponse | render(String
the name of the template to be rendered name, Object... the modelAttributes used to render the template modelAttributes)Implements org. Render the template with the given |
| public ServerResponse | render(String
the name of the template to be rendered name, Map<String, ?> the model used to render the template model)Implements org. Render the template with the given |
| public ServerResponse. | varyBy(String...
request header names requestHeaders)Implements org. Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. |
| cookies | back to summary |
|---|---|
| private final MultiValueMap<String, Cookie> cookies | |
| headers | back to summary |
|---|---|
| private final HttpHeaders headers | |
| statusCode | back to summary |
|---|---|
| private final HttpStatusCode statusCode | |
| DefaultServerResponseBuilder | back to summary |
|---|---|
| public DefaultServerResponseBuilder(ServerResponse other) | |
| DefaultServerResponseBuilder | back to summary |
|---|---|
| public DefaultServerResponseBuilder(HttpStatusCode status) | |
| allow | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the set of allowed
| |
| allow | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the set of allowed
| |
| body | back to summary |
|---|---|
| public ServerResponse body(Object body) Implements org. Doc from org. Set the body of the response to the given Asynchronous response bodies are supported by providing a
| |
| body | back to summary |
|---|---|
| public <T> ServerResponse body(T body, ParameterizedTypeReference<T> bodyType) Implements org. Doc from org. Set the body of the response to the given
| |
| build | back to summary |
|---|---|
| public ServerResponse build() Implements org. Doc from org. Build the response entity with no body.
| |
| build | back to summary |
|---|---|
| public ServerResponse build(ServerResponse. Implements org. Doc from org. Build the response entity with a custom write function.
| |
| cacheControl | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the caching directives for the resource, as specified by the HTTP 1.1
A
| |
| contentLength | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the length of the body in bytes, as specified by the
| |
| contentType | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the media type of the body, as specified by the
| |
| cookie | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Add the given cookie to the response.
| |
| cookies | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Manipulate this response's cookies with the given consumer. The
cookies provided to the consumer are "live", so that the consumer can be used to
overwrite existing cookies,
remove cookies, or use any of the other
| |
| eTag | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the entity tag of the body, as specified by the
| |
| header | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Add the given header value(s) under the given name.
| |
| headers | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Manipulate this response's headers with the given consumer. The
headers provided to the consumer are "live", so that the consumer can be used to
overwrite existing header values,
remove values, or use any of the other
| |
| lastModified | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the time the resource was last changed, as specified by the
| |
| lastModified | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the time the resource was last changed, as specified by the
| |
| location | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Set the location of a resource, as specified by the
| |
| render | back to summary |
|---|---|
| public ServerResponse render(String name, Object... modelAttributes) Implements org. Doc from org. Render the template with the given Note Empty
| |
| render | back to summary |
|---|---|
| public ServerResponse render(String name, Map<String, ?> model) Implements org. Doc from org. Render the template with the given
| |
| varyBy | back to summary |
|---|---|
| public ServerResponse. Implements org. Doc from org. Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. The configured request header names are added only if not already present in the response "Vary" header.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ServerResponse. |
| Access | Constructor and Description |
|---|---|
| public | WriteFunctionResponse(HttpStatusCode statusCode, HttpHeaders headers, MultiValueMap<String, Cookie> cookies, ServerResponse.
|
| Modifier and Type | Method and Description |
|---|---|
| protected ModelAndView | writeToInternal(HttpServletRequest request, HttpServletResponse response, ServerResponse.
Implements abstract org.
|
| writeFunction | back to summary |
|---|---|
| private final ServerResponse. | |
| WriteFunctionResponse | back to summary |
|---|---|
| public WriteFunctionResponse(HttpStatusCode statusCode, HttpHeaders headers, MultiValueMap<String, Cookie> cookies, ServerResponse. | |
| writeToInternal | back to summary |
|---|---|
| protected ModelAndView writeToInternal(HttpServletRequest request, HttpServletResponse response, ServerResponse. Implements abstract org.
| |