Class XmlViewResolver
- All Implemented Interfaces:
- Aware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ServletContextAware,- ViewResolver
ViewResolver implementation that uses
 bean definitions in a dedicated XML file for view definitions, specified by
 resource location. The file will typically be located in the WEB-INF directory;
 the default is "/WEB-INF/views.xml".
 This ViewResolver does not support internationalization at the level
 of its definition resources. Consider ResourceBundleViewResolver if you
 need to apply different view resources per locale.
 
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.
- Since:
- 18.06.2003
- Author:
- Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolverAbstractCachingViewResolver.CacheFilter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Default if no other location is supplied.Fields inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolverDEFAULT_CACHE_LIMITFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeprecated.Pre-initialize the factory from the XML file.voiddestroy()Deprecated.Close the view bean factory on context shutdown.protected ObjectgetCacheKey(String viewName, Locale locale) Deprecated.This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.intgetOrder()Deprecated.Get the order value of this object.protected BeanFactoryDeprecated.Initialize the view bean factory from the XML file.protected ViewDeprecated.Subclasses must implement this method, building a View object for the specified view.voidsetLocation(Resource location) Deprecated.Set the location of the XML file that defines the view beans.voidsetOrder(int order) Deprecated.Specify the order value for this ViewResolver bean.Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolverclearCache, createView, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheFilter, setCacheLimit, setCacheUnresolvedMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Field Details- 
DEFAULT_LOCATIONDeprecated.Default if no other location is supplied.- See Also:
 
 
- 
- 
Constructor Details- 
XmlViewResolverpublic XmlViewResolver()Deprecated.
 
- 
- 
Method Details- 
setLocationDeprecated.Set the location of the XML file that defines the view beans.The default is "/WEB-INF/views.xml". - Parameters:
- location- the location of the XML file.
 
- 
setOrderpublic void setOrder(int order) Deprecated.Specify the order value for this ViewResolver bean.The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.- See Also:
 
- 
getOrderpublic int getOrder()Deprecated.Description copied from interface:OrderedGet 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-startupvalues).Same order values will result in arbitrary sort positions for the affected objects. 
- 
afterPropertiesSetDeprecated.Pre-initialize the factory from the XML file. Only effective if caching is enabled.- Specified by:
- afterPropertiesSetin interface- InitializingBean
- Throws:
- BeansException
 
- 
getCacheKeyDeprecated.This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.- Overrides:
- getCacheKeyin class- AbstractCachingViewResolver
 
- 
loadViewDeprecated.Description copied from class:AbstractCachingViewResolverSubclasses must implement this method, building a View object for the specified view. The returned View objects will be cached by this ViewResolver base class.Subclasses are not forced to support internationalization: A subclass that does not may simply ignore the locale parameter. - Specified by:
- loadViewin class- AbstractCachingViewResolver
- Parameters:
- viewName- the name of the view to retrieve
- locale- the Locale to retrieve the view for
- Returns:
- the View instance, or nullif not found (optional, to allow for ViewResolver chaining)
- Throws:
- BeansException
- See Also:
 
- 
initFactoryDeprecated.Initialize the view bean factory from the XML file. Synchronized because of access by parallel threads.- Throws:
- BeansException- in case of initialization errors
 
- 
destroyDeprecated.Close the view bean factory on context shutdown.- Specified by:
- destroyin interface- DisposableBean
- Throws:
- BeansException
 
 
-