05 2021 档案

摘要:@Autowired 有限按照类型查找 再按照属性名称查找bean @Qualifier(value = "asd") @Autowired(required = false) @Qualifier与Autowired 配合使用可以强行指定bean名称 配置类中Bean标识@Primary 表示自动 阅读全文
posted @ 2021-05-31 04:11 杨大德 阅读(62) 评论(0) 推荐(0)
摘要:三种使用 @ToString public class People { @Value("张三") private String name; // SpEl @Value("#{20-2}") private int age; @Value("${people.six}") private Stri 阅读全文
posted @ 2021-05-31 03:29 杨大德 阅读(177) 评论(0) 推荐(0)
摘要:1、第一种方式,@Bean指定initMethod和destoryMethod @Bean(name={"person"},initMethod = "init",destroyMethod = "destroy") public Person person(){ return new Person 阅读全文
posted @ 2021-05-31 02:36 杨大德 阅读(261) 评论(0) 推荐(0)