There's more...

We used a GlassFish 5 to run this recipe. You can do it with whatever Java EE 8 compatible server you want, and you can even use CDI with Java SE without any server. Have a look at the CDI recipe from Chapter 1, New Features and Improvements.

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.