@ -1230,7 +1230,7 @@ public interface FormatterRegistry {
<programlistinglanguage="java"><![CDATA[
<programlistinglanguage="java"><![CDATA[
public class Person {
public class Person {
private String name;
private String name;
private int age;
private int age;
}]]>
}]]>
</programlisting>
</programlisting>
<para>
<para>
@ -1249,12 +1249,12 @@ public class Person {
}]]>
}]]>
</programlisting>
</programlisting>
<para>
<para>
When this object is processed by a JSR-303 Validator, these constraints will be validated.
When an instance of this class is validated by a JSR-303 Validator, these constraints will be enforced.
</para>
</para>
<para>
<para>
For general information on JSR-303, see the <ulinkurl="http://jcp.org/en/jsr/detail?id=303">Bean Validation Specification</ulink>.
For general information on JSR-303, see the <ulinkurl="http://jcp.org/en/jsr/detail?id=303">Bean Validation Specification</ulink>.
For information on the specific capabilities of the default reference implementation, see the <ulinkurl="https://www.hibernate.org/412.html">Hibernate Validator</ulink> documentation.
For information on the specific capabilities of the default reference implementation, see the <ulinkurl="https://www.hibernate.org/412.html">Hibernate Validator</ulink> documentation.
For how to setup a JSR-303 implementation as a Spring bean, keep reading.
To learn how to setup a JSR-303 implementation as a Spring bean, keep reading.
</para>
</para>
</section>
</section>
<sectionid="validation.beanvalidation.spring">
<sectionid="validation.beanvalidation.spring">
@ -1262,7 +1262,7 @@ public class Person {
<para>
<para>
Spring provides full support for the JSR-303 Bean Validation API.
Spring provides full support for the JSR-303 Bean Validation API.
This includes convenient support for bootstrapping a JSR-303 implementation as a Spring bean.
This includes convenient support for bootstrapping a JSR-303 implementation as a Spring bean.
This allows a <code>javax.validation.Validator</code> to be injected wherever validation is needed.
This allows a <code>javax.validation.Validator</code> to be injected wherever validation is needed in your application.
</para>
</para>
<para>
<para>
Use the LocalValidatorFactoryBean to configure a default JSR-303 Validator as a Spring bean:
Use the LocalValidatorFactoryBean to configure a default JSR-303 Validator as a Spring bean:
@ -1272,13 +1272,13 @@ public class Person {
</programlisting>
</programlisting>
<para>
<para>
The basic configuration above will trigger JSR-303 to initialize using its default bootstrap mechanism.
The basic configuration above will trigger JSR-303 to initialize using its default bootstrap mechanism.
The JSR-303 provider, such as Hibernate Validator, will be detected in your classpath automatically.
A JSR-303 provider, such as Hibernate Validator, is expected to be present in the classpath and will be detected automatically.
With JSR-303, the default <code>javax.validation.Validator</code> implementation is quite generic.
With JSR-303, the default <code>javax.validation.Validator</code> implementation is quite generic.
A single instance typically coordinates the validation of <emphasis>all</emphasis> application objects that declare validation constraints.
A single instance typically coordinates the validation of <emphasis>all</emphasis> application objects that declare validation constraints.
To configure such a Validator for use by Spring MVC, simply inject a <code>LocalValidatorFactoryBean</code> reference into the <code>WebBindingInitializer</code> as shown in the previous section.
To configure such a Validator for use by Spring MVC, simply inject a <code>LocalValidatorFactoryBean</code> reference into the <code>WebBindingInitializer</code>.
<code>LocalValidatorFactoryBean</code> already implements <code>org.springframework.validation.Validation</code>, delegating to the JSR-303 provider underneath.
<code>LocalValidatorFactoryBean</code> already implements <code>org.springframework.validation.Validation</code>, delegating to the JSR-303 provider underneath.