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.Orderedpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setServletContext(ServletContext servletContext)
setServletContext in interface org.springframework.web.context.ServletContextAwarepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanException@Nullable public View resolveViewName(String viewName, Locale locale) throws Exception
ViewResolverNote: 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 ViewResolverviewName - name of the view to resolvelocale - the 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)