Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
1fc3fc8b
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
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,发现更多精彩内容 >>
提交
1fc3fc8b
编写于
12月 21, 2015
作者:
S
Stephane Nicoll
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update documentation
Issue: SPR-13471
上级
edd8e2d5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
1 deletion
+14
-1
src/asciidoc/core-beans.adoc
src/asciidoc/core-beans.adoc
+13
-1
src/asciidoc/whats-new.adoc
src/asciidoc/whats-new.adoc
+1
-0
未找到文件。
src/asciidoc/core-beans.adoc
浏览文件 @
1fc3fc8b
...
...
@@ -6788,8 +6788,12 @@ work on the configuration class itself since it is being created as a bean insta
@
Configuration
public
class
RepositoryConfig
{
private
final
DataSource
dataSource
;
@
Autowired
private
DataSource
dataSource
;
public
RepositoryConfig
(
DataSource
dataSource
)
{
this
.
dataSource
=
dataSource
;
}
@
Bean
public
AccountRepository
accountRepository
()
{
...
...
@@ -6817,6 +6821,14 @@ work on the configuration class itself since it is being created as a bean insta
}
----
[
TIP
]
====
Constructor
injection
in
`@
Configuration
`
classes
is
only
supported
as
of
Spring
Framework
4.3
.
Note
also
that
there
is
no
need
to
specify
`@
Autowired
`
if
the
target
bean
defines
only
one
constructor
;
in
the
example
above
,
`@
Autowired
`
is
not
necessary
on
the
`
RepositoryConfig
`
constructor
.
====
.[[
beans
-
java
-
injecting
-
imported
-
beans
-
fq
]]
Fully
-
qualifying
imported
beans
for
ease
of
navigation
--
In
the
scenario
above
,
using
`@
Autowired
`
works
well
and
provides
the
desired
...
...
src/asciidoc/whats-new.adoc
浏览文件 @
1fc3fc8b
...
...
@@ -631,6 +631,7 @@ public @interface MyTestConfig {
* It is no longer necessary to specify the `@Autowired` annotation if the target
bean only define one constructor.
* `@Configuration` classes support constructor injection.
=== Testing Improvements
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录