类 BeanNameViewResolver

java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.view.BeanNameViewResolver
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.context.ApplicationContextAware, cn.taketoday.core.Ordered, ViewResolver

public class BeanNameViewResolver extends cn.taketoday.context.support.ApplicationObjectSupport implements ViewResolver, cn.taketoday.core.Ordered
A simple implementation of ViewResolver that interprets a view name as a bean name in the current application context, i.e. typically in the XML file of the executing DispatcherServlet or in a corresponding configuration class.

Note: This ViewResolver implements the Ordered interface in order to allow for flexible participation in ViewResolver chaining. For example, some special views could be defined via this ViewResolver (giving it 0 as "order" value), while all remaining views could be resolved by a UrlBasedViewResolver.

从以下版本开始:
4.0
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private int
     

    从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport

    applicationContext, log, messageSourceAccessor

    从接口继承的字段 cn.taketoday.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    int
     
    resolveViewName(String viewName, Locale locale)
    Resolve the given view by name.
    void
    setOrder(int order)
    Specify the order value for this ViewResolver bean.

    从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • order

      private int order
  • 构造器详细资料

    • BeanNameViewResolver

      public BeanNameViewResolver()
  • 方法详细资料

    • setOrder

      public void setOrder(int order)
      Specify the order value for this ViewResolver bean.

      The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.

      另请参阅:
      • Ordered.getOrder()
    • getOrder

      public int getOrder()
      指定者:
      getOrder 在接口中 cn.taketoday.core.Ordered
    • resolveViewName

      @Nullable public View resolveViewName(String viewName, Locale locale) throws cn.taketoday.beans.BeansException
      从接口复制的说明: ViewResolver
      Resolve the given view by name.

      Note: To allow for ViewResolver chaining, a ViewResolver should return null if a view with the given name is not defined in it. However, this is not required: Some ViewResolvers will always attempt to build View objects with the given name, unable to return null (rather throwing an exception when View creation failed).

      指定者:
      resolveViewName 在接口中 ViewResolver
      参数:
      viewName - name of the view to resolve
      locale - the Locale in which to resolve the view. ViewResolvers that support internationalization should respect this.
      返回:
      the View object, or null if not found (optional, to allow for ViewResolver chaining)
      抛出:
      cn.taketoday.beans.BeansException