From 50bed38a85564f6a44a1c649c5ef64e015aa5613 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 7 Jul 2015 21:23:02 +0200 Subject: [PATCH] Polishing --- .../support/BindingAwareModelMap.java | 2 +- src/asciidoc/core-beans.adoc | 25 ++++++++++--------- src/asciidoc/web-mvc.adoc | 8 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java index 8e9dc02e16..d6c55115ab 100644 --- a/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java +++ b/spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java @@ -24,7 +24,7 @@ import org.springframework.validation.BindingResult; /** * Subclass of {@link org.springframework.ui.ExtendedModelMap} that automatically removes * a {@link org.springframework.validation.BindingResult} object if the corresponding - * target attribute gets replaced through regulat {@link Map} operations. + * target attribute gets replaced through regular {@link Map} operations. * *

This is the class exposed to handler methods by Spring MVC, typically consumed through * a declaration of the {@link org.springframework.ui.Model} interface. There is no need to diff --git a/src/asciidoc/core-beans.adoc b/src/asciidoc/core-beans.adoc index aee48587d8..b73d0398fc 100644 --- a/src/asciidoc/core-beans.adoc +++ b/src/asciidoc/core-beans.adoc @@ -4281,16 +4281,16 @@ any). These types must be 'wired up' explicitly via XML or using a Spring `@Bean [[beans-autowired-annotation-primary]] -=== Fine-tuning annotation-based autowiring with primary -Because autowiring by type may lead to multiple candidates, it is often necessary to -have more control over the selection process. One way to accomplish this is with -Spring's `@Primary` annotation. `@Primary` indicates that a bean should be given -preference when multiple candidates are qualified to autowire a single-valued dependency. -If exactly one 'primary' bean exists among the candidates, it will be the autowired -value. +=== Fine-tuning annotation-based autowiring with @Primary +Because autowiring by type may lead to multiple candidates, it is often necessary to have +more control over the selection process. One way to accomplish this is with Spring's +`@Primary` annotation. `@Primary` indicates that a particular bean should be given +preference when multiple beans are candidates to be autowired to a single-valued +dependency. If exactly one 'primary' bean exists among the candidates, it will be the +autowired value. -Let's assume the following configuration that define `firstMovieCatalog` as the _primary_ -`MovieCatalog` +Let's assume we have the following configuration that defines `firstMovieCatalog` as the +_primary_ `MovieCatalog`. [source,java,indent=0] [subs="verbatim,quotes"] @@ -4310,7 +4310,8 @@ Let's assume the following configuration that define `firstMovieCatalog` as the } ---- -With such configuration, `MovieRecommender` will use `firstMovieCatalog` +With such configuration, the following `MovieRecommender` will be autowired with the +`firstMovieCatalog`. [source,java,indent=0] [subs="verbatim,quotes"] @@ -4444,14 +4445,14 @@ optional semantic qualifiers. This means that qualifier values, even with the be fallback, always have narrowing semantics within the set of type matches; they do not semantically express a reference to a unique bean id. Good qualifier values are "main" or "EMEA" or "persistent", expressing characteristics of a specific component that are -independent from the bean id, which may be auto-generated in case of an anonymous bean +independent from the bean `id`, which may be auto-generated in case of an anonymous bean definition like the one in the preceding example. Qualifiers also apply to typed collections, as discussed above, for example, to `Set`. In this case, all matching beans according to the declared qualifiers are injected as a collection. This implies that qualifiers do not have to be unique; they rather simply constitute filtering criteria. For example, you can define -multiple `MovieCatalog` beans with the same qualifier value "action"; all of which would +multiple `MovieCatalog` beans with the same qualifier value "action", all of which would be injected into a `Set` annotated with `@Qualifier("action")`. [TIP] diff --git a/src/asciidoc/web-mvc.adoc b/src/asciidoc/web-mvc.adoc index 13296ff925..5f0a6fc4bf 100644 --- a/src/asciidoc/web-mvc.adoc +++ b/src/asciidoc/web-mvc.adoc @@ -4591,10 +4591,10 @@ available. [[mvc-config-conversion]] === Conversion and Formatting -By default formatters for Numbers and Date types are installed, including support for the @NumberFormat -and @DateTimeFormat annotations. Full support for the Joda Time formatting library is also installed -if Joda Time is present on the classpath. To register custom formatters and converters override -the `addFormatters` method: +By default formatters for `Number` and `Date` types are installed, including support for +the `@NumberFormat` and `@DateTimeFormat` annotations. Full support for the Joda Time +formatting library is also installed if Joda Time is present on the classpath. To +register custom formatters and converters, override the `addFormatters` method: [source,java,indent=0] [subs="verbatim,quotes"] -- GitLab