gpt4 book ai didi

spring - 现在 JavaConfigApplicationContext 类在哪里?

转载 作者:IT老高 更新时间:2023-10-28 13:48:02 25 4
gpt4 key购买 nike

maven Artifact 中的 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>

最佳答案

在 Spring 4.2.0 中,为了从 @Configuration 带注释的类中创建 ApplicationContext 的实例,请使用:

ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);

请参阅 this answer由于 JavaConfigApplicationContext 不再存在的原因。

关于spring - 现在 JavaConfigApplicationContext 类在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31886204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com