java.lang.Object | ||
↳ | org.springframework.context.config.AbstractFeatureSpecification | |
↳ | org.springframework.web.servlet.config.MvcAnnotationDriven |
Specifies the Spring MVC "annotation-driven" container feature. The feature provides the following fine-grained configuration:
DefaultAnnotationHandlerMapping
bean for mapping HTTP Servlet Requests
to @Controller
methods using @RequestMapping
annotations.
AnnotationMethodHandlerAdapter
bean for invoking annotated
@Controller
methods.
HandlerExceptionResolver
beans for invoking @ExceptionHandler
controller methods and for mapping Spring exception to HTTP status codes.
The HandlerAdapter
is further configured with the following, which apply
globally (across controllers invoked though the AnnotationMethodHandlerAdapter
):
ConversionService
- a custom instance can be provided via
conversionService(ConversionService)
. Otherwise it defaults to a fresh
ConversionService
instance created by the default
FormattingConversionServiceFactoryBean
.
Validator
- a custom instance can be provided via
validator(Validator)
. Otherwise it defaults to a fresh Validator
instance created by the default LocalValidatorFactoryBean
assuming
JSR-303 API is present on the classpath.
HttpMessageConverter
beans including the Jaxb2RootElementHttpMessageConverter
assuming JAXB2 is present on the
classpath, the MappingJacksonHttpMessageConverter
assuming Jackson
is present on the classpath, and the AtomFeedHttpMessageConverter
and the
RssChannelHttpMessageConverter
converters assuming Rome is present on
the classpath.
WebArgumentResolver
beans to use for resolving
custom arguments to handler methods. These are typically implemented to detect
special parameter types, resolving well-known argument values for them.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.config.AbstractFeatureSpecification
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an MvcAnnotationDriven specification.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The ConversionService to use for type conversion during field binding. | |||||||||||
The ConversionService bean instance to use for type conversion during field binding. | |||||||||||
The MessageCodesResolver to use to build message codes from data binding
and validation error codes.
| |||||||||||
The MessageCodesResolver to use to build message codes from data binding
and validation error codes.
| |||||||||||
The HttpMessageConverter types to use for converting @RequestBody method
parameters and @ResponseBody method return values.
| |||||||||||
Indicates whether or not default HttpMessageConverter registrations should
be added in addition to the ones provided via
messageConverters(HttpMessageConverter) | |||||||||||
The Validator bean instance to use to validate Controller model objects.
| |||||||||||
The Validator bean instance to use to validate Controller model objects.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.context.config.AbstractFeatureSpecification
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.context.config.FeatureSpecification
| |||||||||||
From interface
org.springframework.context.config.SourceAwareSpecification
|
Creates an MvcAnnotationDriven specification.
The ConversionService to use for type conversion during field binding.
This is an alternative to conversionService(ConversionService)
allowing you to provide a bean name rather than a bean instance.
conversionService | the ConversionService bean name |
---|
The ConversionService bean instance to use for type conversion during field binding. This is not required input. It only needs to be provided explicitly if custom converters or formatters need to be configured.
If not provided, a default FormattingConversionService is registered that contains converters to/from standard JDK types. In addition, full support for date/time formatting will be installed if the Joda Time library is present on the classpath.
conversionService | the ConversionService instance to use |
---|
The MessageCodesResolver to use to build message codes from data binding
and validation error codes. This is an alternative to
messageCodesResolver(MessageCodesResolver)
allowing you to provide
a bean name rather than a bean instance.
messageCodesResolver | the MessageCodesResolver bean name |
---|
The MessageCodesResolver to use to build message codes from data binding and validation error codes. This is not required input. If not specified the DefaultMessageCodesResolver is used.
messageCodesResolver | the MessageCodesResolver bean instance |
---|
The HttpMessageConverter types to use for converting @RequestBody method
parameters and @ResponseBody method return values. HttpMessageConverter
registrations provided here will take precedence over HttpMessageConverter
types registered by default.
Also see shouldRegisterDefaultMessageConverters(boolean)
if
default registrations are to be turned off altogether.
converters | the message converters |
---|
Indicates whether or not default HttpMessageConverter registrations should
be added in addition to the ones provided via
messageConverters(HttpMessageConverter)
shouldRegister | true will result in registration of defaults. |
---|
The Validator bean instance to use to validate Controller model objects. This is not required input. It only needs to be specified explicitly if a custom Validator needs to be configured.
If not specified, JSR-303 validation will be installed if a JSR-303 provider is present on the classpath.
validator | the Validator bean instance |
---|
The Validator bean instance to use to validate Controller model objects.
This is an alternative to validator(Validator)
allowing you to
provide a bean name rather than a bean instance.
validator | the Validator bean name |
---|