Loading

随笔分类 -  Spring

摘要:构造器注入 三种依赖注入方式 格式 1. 通过index注入,为index设置需要注入参数的位置(**从0开始**) 2. 通过type注入,以类型注入 3. 通过方法参数名注入,参数名可能会有不稳定情况 <bean id="" class=""> <!-- <constructor-arg ind 阅读全文
posted @ 2020-04-07 18:11 shimeath 阅读(180) 评论(0) 推荐(0)
摘要:singleton 注意事项: 默认为singleton,即为单例。 整个应用共享,需考虑线程安全。 配置方式: <bean id="" class="" scope="singleton" >或<bean id="" class="" > prototype 注意事项: 需要在scope属性中指定 阅读全文
posted @ 2020-04-06 10:23 shimeath 阅读(270) 评论(0) 推荐(0)