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

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; 
 
    ... 
} 
主站蜘蛛池模板: 安龙县| 正镶白旗| 晋江市| 沐川县| 达尔| 深水埗区| 潮州市| 桃园县| 贞丰县| 高雄县| 恭城| 乐安县| 金溪县| 疏勒县| 广安市| 增城市| 洛宁县| 绥芬河市| 南投县| 神池县| 灵丘县| 安国市| 星子县| 宁乡县| 铜鼓县| 瑞丽市| 蓬安县| 黄浦区| 嵊州市| 大丰市| 乐平市| 肃南| 永春县| 镇宁| 嵊泗县| 仁寿县| 大理市| 左云县| 桂林市| 博爱县| 北碚区|