- Developing Middleware in Java EE 8
- Abdalla Mahmoud
- 58字
- 2021-07-23 19:24:33
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
推薦閱讀
- C++程序設(shè)計(jì)教程
- 數(shù)據(jù)庫系統(tǒng)教程(第2版)
- 零起步玩轉(zhuǎn)掌控板與Mind+
- Machine Learning with R Cookbook(Second Edition)
- C和C++安全編碼(原書第2版)
- C語言程序設(shè)計(jì)
- MySQL從入門到精通(軟件開發(fā)視頻大講堂)
- 網(wǎng)絡(luò)數(shù)據(jù)采集技術(shù):Java網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)
- ActionScript 3.0從入門到精通(視頻實(shí)戰(zhàn)版)
- Learning Ionic
- MyBatis 3源碼深度解析
- iOS開發(fā)項(xiàng)目化入門教程
- Spring Boot從入門到實(shí)戰(zhàn)
- Python趣味創(chuàng)意編程
- 美麗洞察力:從化妝品行業(yè)看顧客需求洞察