java.lang.Object | ||||
↳ | org.springframework.context.support.ApplicationObjectSupport | |||
↳ | org.springframework.web.context.support.WebApplicationObjectSupport | |||
↳ | org.springframework.web.servlet.view.AbstractCachingViewResolver | |||
↳ | org.springframework.web.servlet.view.XmlViewResolver |
Implementation of ViewResolver that uses bean definitions in an XML file, specified by resource location. The file will typically be located in the WEB-INF directory; default is "/WEB-INF/views.xml".
This ViewResolver does not support internationalization. Consider ResourceBundleViewResolver if you need to apply different view resources per locale.
Note: This ViewResolver implements the Ordered interface 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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_LOCATION | Default if no other location is supplied |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.core.Ordered
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.support.ApplicationObjectSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Pre-initialize the factory from the XML file.
| |||||||||||
Close the view bean factory on context shutdown.
| |||||||||||
Return the order value of this object, with a
higher value meaning greater in terms of sorting.
| |||||||||||
Set the location of the XML file that defines the view beans.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This implementation returns just the view name,
as XmlViewResolver doesn't support localized resolution.
| |||||||||||
Initialize the view bean factory from the XML file.
| |||||||||||
Subclasses must implement this method, building a View object
for the specified view.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.servlet.view.AbstractCachingViewResolver
| |||||||||||
From class
org.springframework.web.context.support.WebApplicationObjectSupport
| |||||||||||
From class
org.springframework.context.support.ApplicationObjectSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.context.ApplicationContextAware
| |||||||||||
From interface
org.springframework.core.Ordered
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
| |||||||||||
From interface
org.springframework.web.servlet.ViewResolver
|
Default if no other location is supplied
Pre-initialize the factory from the XML file. Only effective if caching is enabled.
BeansException |
---|
Return the order value of this object, with a higher value meaning greater in terms of sorting.
Normally starting with 0, with Integer.MAX_VALUE
indicating the greatest value. Same order values will result
in arbitrary positions for the affected objects.
Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).
Set the location of the XML file that defines the view beans.
The default is "/WEB-INF/views.xml".
location | the location of the XML file. |
---|
This implementation returns just the view name, as XmlViewResolver doesn't support localized resolution.
Initialize the view bean factory from the XML file. Synchronized because of access by parallel threads.
BeansException | in case of initialization errors |
---|
Subclasses 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.
viewName | the name of the view to retrieve |
---|---|
locale | the Locale to retrieve the view for |
null
if not found
(optional, to allow for ViewResolver chaining)BeansException |
---|