BINDING_CONTEXT_ATTRIBUTE| Constructor and Description |
|---|
HttpMessageWriterView(org.springframework.core.codec.Encoder<?> encoder)
Constructor with an
Encoder. |
HttpMessageWriterView(org.springframework.http.codec.HttpMessageWriter<?> writer)
Constructor with a fully initialized
HttpMessageWriter. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.codec.HttpMessageWriter<?> |
getMessageWriter()
Return the configured message writer.
|
Set<String> |
getModelKeys()
Return the configured model keys.
|
List<org.springframework.http.MediaType> |
getSupportedMediaTypes()
Return the list of media types this View supports, or an empty list.
|
reactor.core.publisher.Mono<Void> |
render(Map<String,?> model,
org.springframework.http.MediaType contentType,
org.springframework.web.server.ServerWebExchange exchange)
Render the view based on the given
HandlerResult. |
void |
setModelKeys(Set<String> modelKeys)
Set the attributes in the model that should be rendered by this view.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRedirectViewpublic HttpMessageWriterView(org.springframework.core.codec.Encoder<?> encoder)
Encoder.public HttpMessageWriterView(org.springframework.http.codec.HttpMessageWriter<?> writer)
HttpMessageWriter.public org.springframework.http.codec.HttpMessageWriter<?> getMessageWriter()
public List<org.springframework.http.MediaType> getSupportedMediaTypes()
The implementation of this method for HttpMessageWriterView
delegates to HttpMessageWriter.getWritableMediaTypes().
getSupportedMediaTypes in interface Viewpublic void setModelKeys(@Nullable
Set<String> modelKeys)
HttpMessageWriter.canWrite(org.springframework.core.ResolvableType, org.springframework.http.MediaType).
The matching attributes are processed as follows:
Map, write all matches;
otherwise raise an IllegalStateException.
public reactor.core.publisher.Mono<Void> render(@Nullable Map<String,?> model, @Nullable org.springframework.http.MediaType contentType, org.springframework.web.server.ServerWebExchange exchange)
ViewHandlerResult. Implementations
can access and use the model or only a specific attribute in it.render in interface Viewmodel - a Map with name Strings as keys and corresponding model
objects as values (Map can also be null in case of empty model)contentType - the content type selected to render with which should
match one of the supported media types.exchange - the current exchangeMono to represent when and if rendering succeeds