Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.-Smile-.
spring-framework
提交
50bed38a
S
spring-framework
项目概览
.-Smile-.
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
50bed38a
编写于
7月 07, 2015
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
6890e65d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
17 deletion
+18
-17
spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java
...ingframework/validation/support/BindingAwareModelMap.java
+1
-1
src/asciidoc/core-beans.adoc
src/asciidoc/core-beans.adoc
+13
-12
src/asciidoc/web-mvc.adoc
src/asciidoc/web-mvc.adoc
+4
-4
未找到文件。
spring-context/src/main/java/org/springframework/validation/support/BindingAwareModelMap.java
浏览文件 @
50bed38a
...
...
@@ -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 regula
t
{@link Map} operations.
* target attribute gets replaced through regula
r
{@link Map} operations.
*
* <p>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
...
...
src/asciidoc/core-beans.adoc
浏览文件 @
50bed38a
...
...
@@ -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
p
rimary
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
@P
rimary
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
<
MovieCatalog
>`.
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
<
MovieCatalog
>`
annotated
with
`@
Qualifier
(
"action"
)`.
[
TIP
]
...
...
src/asciidoc/web-mvc.adoc
浏览文件 @
50bed38a
...
...
@@ -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"]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录