Map Implementing RESTful views of EJB applications using JAX-RS

If you have enterprise JavaBeans (EJB) applications, you can expose a RESTful interface to the enterprise bean using Java API for RESTful Web Services (JAX-RS). By implementing JAX-RS annotated enterprise beans, you keep the EJB functionality including transaction support, injection of Java EE components and resources, and other EJB session bean capabilities.

About this task

Before EJB 3.1, enterprise beans that required an EJB local client view also needed a separate Java interface, usually located in a separate file, that declared the local view methods. The enterprise bean specified that it implemented the EJB local view interface using deployment descriptors or EJB annotations.

Using the EJB 3.1 specification, you have the option of exposing a local view of an enterprise bean without an explicit EJB local interface. Instead, the enterprise bean has a no-interface client view that is based on the public methods of your bean class. No-interface view enterprise beans can be more simple to develop than a local view enterprise bean for the following reasons: See the EJB 3.1 specification for more details on the no-interface views of an enterprise bean.
New feature New feature: JAX-RS supports the use of enterprise beans that declare a local business interface and no-interface view enterprise beans. newfeat

Procedure

  1. Configure the development environment.
  2. Define the resources in JAX-RS web applications.
  3. Configure the JAX-RS application.
  4. Implement RESTful views of enterprise beans.
  5. Assemble JAX-RS web applications.
  6. Deploy JAX-RS web applications.

Results

You have enabled an enterprise bean so that JAX-RS resources are exposed for consumption.




In this information ...


(Index)

IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.



Terms of Use | Feedback

Last updated: Sep 19, 2011 4:14:10 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-base-dist&topic=twbs_jaxrs_ejb
File name: twbs_jaxrs_ejb.html