spring bean配置文件(spring基礎二)

背景:今天看了spring測試工程bean的xml配置文件,整體複習一下bean基礎。 我目前常見bean屬性:id,class,property這三個。 1.id和class id:是這個bean在全局的唯一標識。 class:是被@server註解的類的位置,一般包名+類名。 舉個例子: 定義一個抽象接口,被@server註解[email protected]和@Component都是用來註解
相關文章
相關標籤/搜索