官术网_书友最值得收藏!

Injecting beans

As you saw in previous examples, the @Inject annotation allows us to inject a bean as a field in another bean during its instantiation. However, the use of @Inject is not limited to fields only, as there are three valid mechanisms for injecting CDI beans:

  • Direct field injection
  • Bean constructor parameter injection
  • Initializer method parameter injection
主站蜘蛛池模板: 庆元县| 灌南县| 鹤峰县| 巩义市| 井陉县| 吉首市| 龙南县| 于都县| 文成县| 驻马店市| 孝感市| 凤台县| 萨迦县| 安康市| 兴化市| 海晏县| 西华县| 顺平县| 临江市| 泸西县| 通榆县| 隆化县| 浙江省| 灵宝市| 晴隆县| 晋中市| 五家渠市| 广州市| 长海县| 浑源县| 通州区| 措勤县| 花垣县| 叶城县| 永城市| 都安| 九寨沟县| 丹江口市| 五寨县| 溆浦县| 尖扎县|