Package org.springframework.web.servlet.config

# Class ViewResolversBeanDefinitionParser

java.lang.Object
org.springframework.web.servlet.config.ViewResolversBeanDefinitionParser

All Implemented Interfaces:
  `org.springframework.beans.factory.xml.BeanDefinitionParser`

public class ViewResolversBeanDefinitionParser extends Object implements org.springframework.beans.factory.xml.BeanDefinitionParser
Parses the `view-resolvers` MVC namespace element and registers `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.

Since:
  4.1
Author:
  Sivaprasad Valluru, Sebastien Deleuze, Rossen Stoyanchev
See Also:
  - `FreeMarkerConfigurerBeanDefinitionParser`
  - `GroovyMarkupConfigurerBeanDefinitionParser`
  - `ScriptTemplateConfigurerBeanDefinitionParser`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VIEW_RESOLVER_BEAN_NAME`
The bean name used for the `ViewResolverComposite`.

## Constructor Summary

Constructors
Constructor
Description
`ViewResolversBeanDefinitionParser()`

## Method Summary

Modifier and Type
Method
Description
`org.springframework.beans.factory.config.BeanDefinition`
`parse(Element element, org.springframework.beans.factory.xml.ParserContext context)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### VIEW_RESOLVER_BEAN_NAME

public static final String VIEW_RESOLVER_BEAN_NAME
The bean name used for the `ViewResolverComposite`.

See Also:
  - Constant Field Values

## Constructor Details

### ViewResolversBeanDefinitionParser

public ViewResolversBeanDefinitionParser()

## Method Details

### parse

@Nullable public org.springframework.beans.factory.config.BeanDefinition parse(Element element, org.springframework.beans.factory.xml.ParserContext context)

Specified by:
  `parse` in interface `org.springframework.beans.factory.xml.BeanDefinitionParser`