类 ViewResolverComposite
- java.lang.Object
- org.springframework.web.servlet.view.ViewResolverComposite
- 所有已实现的接口:
Aware
,InitializingBean
,ApplicationContextAware
,Ordered
,ServletContextAware
,ViewResolver
public class ViewResolverComposite extends Object implements ViewResolver, Ordered, InitializingBean, ApplicationContextAware, ServletContextAware
AViewResolver
that delegates to others.- 从以下版本开始:
- 4.1
- 作者:
- Sebastien Deleuze, Rossen Stoyanchev
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 ViewResolverComposite()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.int
getOrder()
Get the order value of this object.List<ViewResolver>
getViewResolvers()
Return the list of view viewResolvers to delegate to.View
resolveViewName(String viewName, Locale locale)
Resolve the given view by name.void
setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.void
setOrder(int order)
void
setServletContext(ServletContext servletContext)
Set theServletContext
that this object runs in.void
setViewResolvers(List<ViewResolver> viewResolvers)
Set the list of view viewResolvers to delegate to.
构造器详细资料
ViewResolverComposite
public ViewResolverComposite()
方法详细资料
setViewResolvers
public void setViewResolvers(List<ViewResolver> viewResolvers)
Set the list of view viewResolvers to delegate to.
getViewResolvers
public List<ViewResolver> getViewResolvers()
Return the list of view viewResolvers to delegate to.
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
setApplicationContext
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
从接口复制的说明:ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.Invoked after population of normal bean properties but before an init callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked afterResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
andMessageSourceAware
, if applicable.- 指定者:
setApplicationContext
在接口中ApplicationContextAware
- 参数:
applicationContext
- the ApplicationContext object to be used by this object- 抛出:
ApplicationContextException
- in case of context initialization errorsBeansException
- if thrown by application context methods- 另请参阅:
BeanInitializationException
setServletContext
public void setServletContext(ServletContext servletContext)
从接口复制的说明:ServletContextAware
Set theServletContext
that this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's
afterPropertiesSet
or a custom init-method. Invoked after ApplicationContextAware'ssetApplicationContext
.- 指定者:
setServletContext
在接口中ServletContextAware
- 参数:
servletContext
- ServletContext object to be used by this object- 另请参阅:
InitializingBean.afterPropertiesSet()
,ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)
afterPropertiesSet
public void afterPropertiesSet() throws Exception
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
resolveViewName
public View resolveViewName(String viewName, Locale locale) throws Exception
从接口复制的说明: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 returnnull
(rather throwing an exception when View creation failed).- 指定者:
resolveViewName
在接口中ViewResolver
- 参数:
viewName
- name of the view to resolvelocale
- 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) - 抛出:
Exception
- if the view cannot be resolved (typically in case of problems creating an actual View object)