Spring的实例化和依赖注入时机与延迟实例化

Spring的实例化 使用@Autowired能够注入一个bean进来java @Autowired private Diana diana; 那么若是在容器中没有Diana的对象被实例化的时候应用程序会报错吗?咱们能够经过把Diana上面的@Component注释掉来看一下结果如何web //@Component public class Diana { public void r()
相关文章
相关标签/搜索