liguofeng29’s blog

個人勉強用ブログだっす。

Spring4 - 設定ファイル関連キーワード

  1. <beans.../> : Spring設定ファイルのルート

    • defalut-lazy-init
    • defalut-merge
    • defalut-autowire
    • defalut-autowire-condidates
    • defalut-init-method
    • defalut-destory-method
  2. <bean.../>

    • id : 唯一識別
    • class : クラス指定
    • name : カンマ区切りで複数指定可能
  3. スコープ

    • singoleton
    • prototype
    • request
    • session
    • global session
  4. DI

    • setter : <property.../>
    • contructor - <constructor-arg.../>
  5. Bean注入

    • 手動 : <ref.../>
    • 自動(autowire, default-autowire)

      • no
      • byName
      • byType
      • constructor
      • autodetect
  6. ネストbean : 直接Springコンテナーにアクセスされたくない

    • <property.../> OR <constructor-arg.../>の子要素で<bean.../>を定義する
  7. 集合注入

    • <list.../> : List
    • <set.../> : Set
    • <map.../> : Map
    • <props.../> : Properties