Top Description Fields Constructors Methods
org.springframework.web.servlet.config

public Class ViewResolversBeanDefinitionParser

extends Object
implements BeanDefinitionParser
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.xml.BeanDefinitionParser
Imports
java.util.List, org.w3c.dom.Element, org.springframework.beans.MutablePropertyValues, org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.factory.parsing.BeanComponentDefinition, .CompositeComponentDefinition, org.springframework.beans.factory.support.ManagedList, .RootBeanDefinition, org.springframework.beans.factory.xml.BeanDefinitionParser, .ParserContext, org.springframework.core.Ordered, org.springframework.util.xml.DomUtils, org.springframework.web.servlet.view.BeanNameViewResolver, .ContentNegotiatingViewResolver, .InternalResourceViewResolver, .ViewResolverComposite, org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver, org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver, org.springframework.web.servlet.view.script.ScriptTemplateViewResolver

Parses the view-resolvers MVC namespace element and registers org.springframework.web.servlet.ViewResolver bean definitions.

All registered resolvers are wrapped in a single (composite) ViewResolver with its order property set to 0 so that other external resolvers may be ordered before or after it.

When content negotiation is enabled the order property is set to highest priority instead with the ContentNegotiatingViewResolver encapsulating all other registered view resolver instances. That way the resolvers registered through the MVC namespace form a self-encapsulated resolver chain.

Authors
Sivaprasad Valluru, Sebastien Deleuze, Rossen Stoyanchev
Since
4.1
See Also
FreeMarkerConfigurerBeanDefinitionParser, GroovyMarkupConfigurerBeanDefinitionParser, ScriptTemplateConfigurerBeanDefinitionParser

Field Summary

Modifier and TypeField and Description
public static final String
VIEW_RESOLVER_BEAN_NAME

The bean name used for the ViewResolverComposite.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private BeanDefinition
public BeanDefinition
parse(Element
the element that is to be parsed into one or more BeanDefinitions
element
,
ParserContext
the object encapsulating the current state of the parsing process; provides access to a org.springframework.beans.factory.support.BeanDefinitionRegistry
context
)

Implements org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Parse the specified Element and register the resulting BeanDefinition(s) with the BeanDefinitionRegistry embedded in the supplied ParserContext.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VIEW_RESOLVER_BEAN_NAMEback to summary
public static final String VIEW_RESOLVER_BEAN_NAME

The bean name used for the ViewResolverComposite.

Constructor Detail

ViewResolversBeanDefinitionParserback to summary
public ViewResolversBeanDefinitionParser()

Method Detail

addUrlBasedViewResolverPropertiesback to summary
private void addUrlBasedViewResolverProperties(Element element, RootBeanDefinition beanDefinition)
createContentNegotiatingViewResolverback to summary
private BeanDefinition createContentNegotiatingViewResolver(Element resolverElement, ParserContext context)
parseback to summary
public BeanDefinition parse(Element element, ParserContext context)

Implements org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Doc from org.springframework.beans.factory.xml.BeanDefinitionParser.parse.

Parse the specified Element and register the resulting BeanDefinition(s) with the BeanDefinitionRegistry embedded in the supplied ParserContext.

Implementations must return the primary BeanDefinition that results from the parse if they will ever be used in a nested fashion (for example as an inner tag in a <property/> tag). Implementations may return null if they will not be used in a nested fashion.

Parameters
element:Element

the element that is to be parsed into one or more BeanDefinitions

context:ParserContext

the object encapsulating the current state of the parsing process; provides access to a org.springframework.beans.factory.support.BeanDefinitionRegistry

Returns:BeanDefinition

the primary BeanDefinition

Annotations
@Override