Spring4 - 設定ファイル関連キーワード
<beans.../> : Spring設定ファイルのルート
- defalut-lazy-init
- defalut-merge
- defalut-autowire
- defalut-autowire-condidates
- defalut-init-method
- defalut-destory-method
<bean.../>
- id : 唯一識別
- class : クラス指定
- name : カンマ区切りで複数指定可能
スコープ
- singoleton
- prototype
- request
- session
- global session
DI
- setter : <property.../>
- contructor - <constructor-arg.../>
Bean注入
- 手動 : <ref.../>
自動(autowire, default-autowire)
- no
- byName
- byType
- constructor
- autodetect
ネストbean : 直接Springコンテナーにアクセスされたくない
- <property.../> OR <constructor-arg.../>の子要素で<bean.../>を定義する
集合注入
- <list.../> : List
- <set.../> : Set
- <map.../> : Map
- <props.../> : Properties