2022最新Docker進(jìn)階課程馬老師
2022-11-20 10:47 作者:janet19961217 | 我要投稿
@Servicepublic class PersonService2 implements ApplicationContextAware {
? ?private ApplicationContext applicationContext;
? ?@Override
? ?public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
? ? ? ?this.applicationContext = applicationContext;
? ?}
? ?public void add() {
? ? ? ?Person person = (Person) applicationContext.getBean("person");
? ?}}
標(biāo)簽: