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

Direct field injection

Direct field injection is almost the easiest and most common mechanism for injecting CDI beans. By direct field injection, we mean that we define the injection point as an instance variable within another bean, then we use the @Inject annotation to request dependency injection. We have already used this mechanism in previous examples, so just to recall its code:

@Dependent 
public class AnotherPojo { 
 
    @Inject 
    private MyPojo myPojo; 
 
    ... 
} 
主站蜘蛛池模板: 上饶市| 邢台县| 永昌县| 靖州| 阜南县| 仁怀市| 谢通门县| 久治县| 阿合奇县| 宜兰县| 中方县| 屯留县| 漾濞| 柳林县| 达拉特旗| 龙里县| 文安县| 泽州县| 新乐市| 荣昌县| 淮阳县| 延安市| 东至县| 囊谦县| 孟州市| 延庆县| 新干县| 恩平市| 和平区| 邯郸市| 普定县| 迁安市| 阿拉善左旗| 蓝田县| 赤水市| 许昌市| 乌海市| 玉树县| 囊谦县| 嘉峪关市| 河津市|