public class ViewResolverComposite extends Object implements ViewResolver, org.springframework.core.Ordered, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware
ViewResolver
that delegates to others.Constructor and Description |
---|
ViewResolverComposite() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
int |
getOrder() |
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(org.springframework.context.ApplicationContext applicationContext) |
void |
setOrder(int order) |
void |
setServletContext(ServletContext servletContext) |
void |
setViewResolvers(List<ViewResolver> viewResolvers)
Set the list of view viewResolvers to delegate to.
|
public void setViewResolvers(List<ViewResolver> viewResolvers)
public List<ViewResolver> getViewResolvers()
public void setOrder(int order)
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setServletContext(ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public View resolveViewName(String viewName, Locale locale) throws Exception
ViewResolver
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
in interface ViewResolver
viewName
- name of the view to resolvelocale
- Locale in which to resolve the view.
ViewResolvers that support internationalization should respect this.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)