HandlerResultHandler that encapsulates the view resolution algorithm
supporting the following return types:
Void, void, or no value -- default view nameString -- view name unless @ModelAttribute-annotated
View -- View to render with
Model -- attributes to add to the model
Map -- attributes to add to the model
Rendering -- use case driven API for view resolution@ModelAttribute -- attribute for the model
A String-based view name is resolved through the configured
ViewResolver instances into a View to use for rendering.
If a view is left unspecified (e.g. by returning null or a
model-related return value), a default view name is selected.
By default this resolver is ordered at Ordered#LOWEST_PRECEDENCE
and generally needs to be late in the order since it interprets any String
return value as a view name or any non-simple value type as a model attribute
while other result handlers may interpret the same otherwise based on the
presence of annotations, e.g. for @ResponseBody.
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private static final Object | |
| private static final Mono | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ViewResolutionResultHandler(List<ViewResolver>
the resolver to use viewResolvers, RequestedContentTypeResolver to determine the requested content type contentTypeResolver)Basic constructor with a default |
| public | ViewResolutionResultHandler(List<ViewResolver>
the view resolver to use viewResolvers, RequestedContentTypeResolver to determine the requested content type contentTypeResolver, ReactiveAdapterRegistry for adaptation to reactive types registry)Constructor with an |
| Modifier and Type | Method and Description |
|---|---|
| private String | getDefaultViewName(ServerWebExchange exchange)
Select a default view name when a controller did not specify it. |
| public List | |
| private List | |
| private String | |
| public List | |
| public Mono | handleResult(ServerWebExchange
current server exchange exchange, HandlerResult the result from the handling result)Implements org. Process the given result modifying response headers and/or writing data to the response. |
| private boolean | |
| private Mono | render(List<View> views, Map<String, Object> model, BindingContext bindingContext, ServerWebExchange exchange)
|
| private Mono | renderWith(View view, Map<String, Object> model, MediaType mediaType, ServerWebExchange exchange, BindingContext bindingContext)
|
| private Mono | |
| public void | setDefaultViews(List<View> defaultViews)
Set the default views to consider always when resolving view names and trying to satisfy the best matching content type. |
| public boolean | supports(HandlerResult
the result object to check result)Implements org. Whether this handler supports the given |
| defaultViews | back to summary |
|---|---|
| private final List<View> defaultViews | |
| NO_VALUE | back to summary |
|---|---|
| private static final Object NO_VALUE | |
| NO_VALUE_MONO | back to summary |
|---|---|
| private static final Mono<Object> NO_VALUE_MONO | |
| viewResolvers | back to summary |
|---|---|
| private final List<ViewResolver> viewResolvers | |
| ViewResolutionResultHandler | back to summary |
|---|---|
| public ViewResolutionResultHandler(List<ViewResolver> viewResolvers, RequestedContentTypeResolver contentTypeResolver) Basic constructor with a default
| |
| ViewResolutionResultHandler | back to summary |
|---|---|
| public ViewResolutionResultHandler(List<ViewResolver> viewResolvers, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry registry) Constructor with an
| |
| getDefaultViewName | back to summary |
|---|---|
| private String getDefaultViewName(ServerWebExchange exchange) Select a default view name when a controller did not specify it. Use the request path the leading and trailing slash stripped. | |
| getDefaultViews | back to summary |
|---|---|
| public List Return the configured default | |
| getMediaTypes | back to summary |
|---|---|
| private List | |
| getNameForReturnValue | back to summary |
|---|---|
| private String getNameForReturnValue(MethodParameter returnType) | |
| getViewResolvers | back to summary |
|---|---|
| public List Return a read-only list of view resolvers. | |
| handleResult | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Process the given result modifying response headers and/or writing data to the response.
| |
| hasModelAnnotation | back to summary |
|---|---|
| private boolean hasModelAnnotation(MethodParameter parameter) | |
| render | back to summary |
|---|---|
| private Mono | |
| renderWith | back to summary |
|---|---|
| private Mono | |
| resolveViews | back to summary |
|---|---|
| private Mono | |
| setDefaultViews | back to summary |
|---|---|
| public void setDefaultViews(List<View> defaultViews) Set the default views to consider always when resolving view names and trying to satisfy the best matching content type. | |
| supports | back to summary |
|---|---|
| public boolean supports(HandlerResult result) Implements org. Doc from org. Whether this handler supports the given
| |