首页>代码>Spring自定义类似@Required注解实现在容器启动时对bean进行依赖校验>/custom-spring-@required-annotation-example/src/main/java/com/memorynotfound/spring/core/required/Main.java
package com.memorynotfound.spring.core.required; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class Main { public static void main(String... args) { ApplicationContext context = new ClassPathXmlApplicationContext("app-config.xml"); StarWars starWars = (StarWars)context.getBean("luke"); System.out.println(starWars); starWars = (StarWars)context.getBean("c3po"); System.out.println(starWars); } }


fuyouou LV5
2023年7月6日
szf123 LV12
2023年5月30日
HusKies001
2021年6月29日
暂无贡献等级
wz66666 LV9
2021年6月8日
xiao菜 LV2
2021年6月2日
sanjooo LV5
2021年5月25日
xb1406112453 LV5
2021年4月15日
菜鸟蛋 LV2
2021年3月3日
fkhfsuhfuhflkk LV7
2021年2月20日
555551 LV1
2021年2月7日