public class ViewResolverComposite extends java.lang.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() |
java.util.List<ViewResolver> |
getViewResolvers()
Return the list of view viewResolvers to delegate to.
|
View |
resolveViewName(java.lang.String viewName,
java.util.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(java.util.List<ViewResolver> viewResolvers)
Set the list of view viewResolvers to delegate to.
|
public void setViewResolvers(java.util.List<ViewResolver> viewResolvers)
public java.util.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 java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic View resolveViewName(java.lang.String viewName, java.util.Locale locale) throws java.lang.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 - Locale in which to resolve the view.
ViewResolvers that support internationalization should respect this.null if not found
(optional, to allow for ViewResolver chaining)java.lang.Exception - if the view cannot be resolved
(typically in case of problems creating an actual View object)