- 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; ... }
推薦閱讀
- 少兒人工智能趣味入門:Scratch 3.0動(dòng)畫與游戲編程
- 數(shù)據(jù)庫(kù)系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- Flask Blueprints
- Oracle 11g從入門到精通(第2版) (軟件開發(fā)視頻大講堂)
- 零基礎(chǔ)玩轉(zhuǎn)區(qū)塊鏈
- Apache Spark 2.x Machine Learning Cookbook
- Visual Basic編程:從基礎(chǔ)到實(shí)踐(第2版)
- Full-Stack React Projects
- 概率成形編碼調(diào)制技術(shù)理論及應(yīng)用
- Visual Basic程序設(shè)計(jì)上機(jī)實(shí)驗(yàn)教程
- Node.js從入門到精通
- C++程序設(shè)計(jì)
- 深度學(xué)習(xí)程序設(shè)計(jì)實(shí)戰(zhàn)
- Learning Grunt
- Visual C++程序設(shè)計(jì)與項(xiàng)目實(shí)踐