- Developing Middleware in Java EE 8
- Abdalla Mahmoud
- 73字
- 2021-07-23 19:24:34
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; ... }
推薦閱讀
- Learning Docker
- Raspberry Pi 2 Server Essentials
- C語言實驗指導及習題解析
- 學Python也可以這么有趣
- .NET 3.5編程
- PHP+MySQL+Dreamweaver動態(tài)網站開發(fā)從入門到精通(第3版)
- Python圖形化編程(微課版)
- Unity 2018 Augmented Reality Projects
- Hands-On Neural Network Programming with C#
- 大學計算機基礎
- Vue.js光速入門及企業(yè)項目開發(fā)實戰(zhàn)
- PHP+MySQL動態(tài)網站開發(fā)從入門到精通(視頻教學版)
- Mastering Android Studio 3
- Python物理建模初學者指南(第2版)
- Java Web動態(tài)網站開發(fā)(第2版·微課版)