摘要: 配置 //使用@PropertySource读取外部配置文件中的k/v保存到运行的环境变量中;加载完外部的配置文件以后使用${}取出配置文件的值 @PropertySource(value = {"classpath:/entity1.properties"}) @Configuration pub 阅读全文
posted @ 2022-06-04 19:46 Dabo丶 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1)、指定初始化和销毁方法; 通过@Bean指定init-method和destroy-method; 2)、通过让Bean实现InitializingBean(定义初始化逻辑), DisposableBean(定义销毁逻辑); 3)、可以使用JSR250; @PostConstruct:在bean 阅读全文
posted @ 2022-06-04 18:07 Dabo丶 阅读(773) 评论(0) 推荐(0) 编辑