public interface View
HandlerResult to the HTTP response.
In contrast to an Encoder
which is a singleton and encodes any object of a given type, a View
is typically selected by name and resolved using a ViewResolver
which may for example match it to an HTML template. Furthermore a View
may render based on multiple attributes contained in the model.
A View can also choose to select an attribute from the model use
any existing Encoder to render alternate media types.
| Modifier and Type | Method and Description |
|---|---|
List<MediaType> |
getSupportedMediaTypes()
Return the list of media types this View supports, or an empty list.
|
reactor.core.publisher.Mono<Void> |
render(HandlerResult result,
MediaType contentType,
ServerWebExchange exchange)
Render the view based on the given
HandlerResult. |
List<MediaType> getSupportedMediaTypes()
reactor.core.publisher.Mono<Void> render(HandlerResult result, MediaType contentType, ServerWebExchange exchange)
HandlerResult. Implementations
can access and use the model or only a specific attribute in it.result - the result from handler executioncontentType - 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