- How does the SpringWebFlux framework resolve a View?
The framework invokes ViewResolutionResultHandler using the HandlerResult returned for the endpoint invocation. ViewResolutionResultHandler then determines the correct view by validating the returned value for the following:
- String: If the returned value is a string, then the framework builds a view using the configured ViewResolvers
- Void: If nothing is returned, it then tries to build the default view
- Map: The framework looks for the default view but it also adds the key values returned into the request model
ViewResolutionResultHandler looks up the content type passed in the request. In order to determine which view should be used, it compares the content type passed to the content type supported by ViewResolver. It then selects the first ViewResolver, which supports the request content type...