Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  JavaServerTM Faces Technology

5.  Introduction to Facelets

6.  Unified Expression Language

7.  Using JavaServerTM Faces Technology in Web Pages

8.  Using Converters, Listeners and Validators

9.  Developing With JavaServerTM Faces Technology

10.  Java Servlet Technology

Part III Web Services

11.  Introduction to Web Services

12.  Building Web Services with JAX-WS

13.  Building RESTful Web Services with JAX-RS and Jersey

Part IV Enterprise Beans

14.  Enterprise Beans

15.  Getting Started with Enterprise Beans

16.  Running the Enterprise Bean Examples

Part V Contexts and Dependency Injection for the JavaTM EE Platform

17.  Introduction to Contexts and Dependency Injection for the JavaTM EE Platform

The simplegreeting Example

The simplegreeting Source Files

The Facelets Template and Page

Configuration Files

Building, Packaging, Deploying, and Running the simplegreeting Example

Building and Deploying the simplegreeting Example Using NetBeans IDE

Building, Packaging, and Deploying the simplegreetingExample Using Ant

Running the simplegreeting Example

The guessnumber Example

The guessnumber Source Files

The @MaxNumber and @Random Qualifier Interfaces

The Generator Managed Bean

The UserNumberBean Managed Bean

The Facelets Page

Building, Packaging, Deploying, and Running the guessnumber Example

Building and Deploying the guessnumber Example Using NetBeans IDE

Building, Packaging, and Deploying the guessnumber Example Using Ant

Running the guessnumber Example

Part VI Persistence

19.  Introduction to the Java Persistence API

20.  Running the Persistence Examples

21.  The Java Persistence Query Language

22.  Creating Queries Using the Criteria API

Part VII Security

23.  Introduction to Security in the Java EE Platform

24.  Getting Started Securing Enterprise Applications

25.  Getting Started Securing Web Applications

Part VIII JavaTM EE Supporting Technologies

26.  Introduction to JavaTM EE Supporting Technologies

27.  Transactions

28.  Resource Connections

Index

 

Chapter 18

Running the Basic Contexts and Dependency Injection Examples

This chapter describes in detail how to build and run simple examples that use Contexts and Dependency Injection for the JavaTM EE Platform (CDI).

The examples are in the following directory:

tut-install/examples/cdi/

To build and run the examples, you will do the following:

  1. Use NetBeans IDE or the Ant tool to compile and package the example.

  2. Use NetBeans IDE or the Ant tool to deploy the example.

  3. Run the example in a web browser.

Each example has a build.xml file that refers to files in the following directory:

tut-install/examples/bp-project/

See Chapter 2, Using the Tutorial Examples, for basic information on installing, building, and running the examples.