类 ViewResolutionResultHandler

  • 所有已实现的接口:
    Ordered, HandlerResultHandler

    public class ViewResolutionResultHandler
    extends HandlerResultHandlerSupport
    implements HandlerResultHandler, Ordered
    HandlerResultHandler that encapsulates the view resolution algorithm supporting the following return types:
    • Void or no value -- default view name
    • String -- 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
    • Non-simple value -- 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.

    从以下版本开始:
    5.0
    作者:
    Rossen Stoyanchev