In this detailed Resource page, we feature an abundance of CDI Tutorials!
Contexts and Dependency Injection (CDI) for the Java EE platform is one of several Java EE 6 features that help to knit together the web tier and the transactional tier of the Java EE platform. CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications. Designed for use with stateful objects, CDI also has many broader uses, allowing developers a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way.
CDI is specified by JSR 299, formerly known as Web Beans. Related specifications that CDI uses include the following:
JSR 330, Dependency Injection for Java
The Managed Beans specification, which is an offshoot of the Java EE 6 platform specification (JSR 316)
If you wish to build up your CDI knowledge first, check out our Java EE CDI bean scopes.
CDI Tutorials – Getting Started
Simple examples based on CDI for the Java EE platform
- Java EE CDI ConversationScoped example
In this tutorial we shall show you how to create and use a
ConversationScopedBean in a web application.
- Java EE CDI Producer methods tutorial
In this tutorial we will create a simple service with a
Producermethod to produce and inject our two implementations in an application.
- Java EE CDI Disposer methods example
In this tutorial we will show you how to make use of a
- Java EE CDI Dependency Injection (@Inject) tutorial
In this tutorial we shall show you how to achieve Dependency Injection in CDI managed Beans.
- Java EE CDI programmatic dependency disambiguation example
In this tutorial we shall show you how to avoid dependency disambiguation in CDI beans.
- Java EE CDI programmatic dependency disambiguation example – Injection Point inspection
In this tutorial we shall see how we can avoid programmatic dependency disambiguation when injecting Java EE CDI beans.