Spring 3 introduces a <literal>mvc</literal> XML configuration namespace that simplifies the setup of Spring MVC inside your web application.
Instead of registering low-level beans such as AnnotationMethodHandlerAdapter, you can simply use the namespace and its higher-level constructs.
This is generally preferred unless you require finer-grained control of the configuration at the bean level.
</para>
<para>
The mvc namespace consists of three tags: mvc:annotation-driven, mvc:interceptors, and mvc:view-controller.
Each of these tags is documented below and in the <ulinkurl="http://static.springsource.org/schema/mvc/spring-mvc-3.0.xsd">XML schema</ulink>.
</para>
<sectionid="mvc-annotation-driven">
<title>mvc:annotation-driven</title>
<para>
This tag registers the DefaultAnnotationHandlerMapping and AnnotationMethodHandlerAdapter beans that are required for Spring MVC to dispatch requests to @Controllers.
The tag configures those two beans with sensible defaults based on what is present in your classpath.
The defaults are:
<orderedlist>
<listitem>
<para>
Support for Spring 3's Type <linklinkend="core-convert">ConversionService</link> in addition to JavaBeans PropertyEditors during Data Binding.
A ConversionService instance produced by the <classname>org.springframework.format.support.FormattingConversionServiceFactoryBean</classname> is used by default.
This can be overriden by setting the <literal>conversion-service</literal> attribute.
</para>
</listitem>
<listitem>
<para>
Support for <linklinkend="format">formatting</link> Number fields using the @NumberFormat annotation
</para>
</listitem>
<listitem>
<para>
Support for <linklinkend="format">formatting</link> Date, Calendar, Long, and Joda Time fields using the @DateTimeFormat annotation, if Joda Time is present on the classpath.
</para>
</listitem>
<listitem>
<para>
Support for <linklinkend="validation-mvc-jsr303">validating</link> @Controller inputs with @Valid, if a JSR-303 Provider is present on the classpath.
The validation system can be explicitly configured by setting the <literal>validator</literal> attribute.
</para>
</listitem>
<listitem>
<para>
Support for reading and writing XML, if JAXB is present on the classpath.
</para>
</listitem>
<listitem>
<para>
Support for reading and writing JSON, if Jackson is present on the classpath.