- All Known Implementing Classes:
HandlerResultto the HTTP response.
In contrast to an
which is a singleton and encodes any object of a given type, a
is typically selected by name and resolved using a
which may for example match it to an HTML template. Furthermore a
may render based on multiple attributes contained in the model.
View can also choose to select an attribute from the model use
Encoder to render alternate media types.
- Rossen Stoyanchev
BINDING_CONTEXT_ATTRIBUTEstatic final String BINDING_CONTEXT_ATTRIBUTEThe name of the exchange attribute that contains the
BindingContextfor the request which can be used to create
BindingResultinstances for objects in to the model.
Note: This attribute is not required and may not be present.
getSupportedMediaTypesReturn the list of media types this View supports, or an empty list.
isRedirectViewdefault boolean isRedirectView()Whether this View does rendering by performing a redirect.
(@Nullable Map<String, ?> model, @Nullable MediaType contentType, ServerWebExchange exchange)Render the view based on the given
HandlerResult. Implementations can access and use the model or only a specific attribute in it.
model- a Map with name Strings as keys and corresponding model objects as values (Map can also be
nullin case of empty model)
contentType- the content type selected to render with which should match one of the
supported media types.
exchange- the current exchange
Monoto represent when and if rendering succeeds