1. 程式人生 > >全註解下的spring IOC之其他

全註解下的spring IOC之其他

Bean的作用域

在這裡插入圖片描述

使用@Profile

在這裡插入圖片描述

引入XML配置Bean

在這裡插入圖片描述

使用Spring EL

//讀取屬性檔案
@Value("${database.driverName}")
String driver;
@Value("#{T(System).currentTime()}")
private Long initTime=null;

在這裡插入圖片描述
在這裡插入圖片描述