Suz*_*ioc 11 spring maven spring-java-config
什么是maven工件中的JavaConfigApplicationContext类地址?
无法找到它
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
Con*_*ine 28
在Spring 4.2.0中,为了创建一个ApplicationContext来自@Configuration-annotated类的实例,请使用:
ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
Run Code Online (Sandbox Code Playgroud)
请查看此答案,了解JavaConfigApplicationContext不再存在的原因.
| 归档时间: |
|
| 查看次数: |
5423 次 |
| 最近记录: |