Creating an EJB-based web service using JAX-RS

A RESTful web service is useful for applications which do not require the use of transactions, security and other features that can adversely impact its performance. JAX-RS supports the creation of RESTful applications. These types of services are typified through the use of HTTP commands such as GET and POST. In this recipe, we will use annotations that identify methods of a service corresponding to these commands.

Getting ready

The two basic steps involved in creating a JAX-RS web service include:

  1. Creating an EJB which provides the application's functionality
  2. Creating a Web Service (JAX-RS) which utilizes the EJB

    We will reuse the CustomerManager class as described in the first recipe to provide our ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.