tree: 4df49cca99d4ccae8d4b11527110f228d4112a92 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.MD
examples/jersey-ejb/README.MD

Jersey EJB Example

This example demonstrates how to develop RESTful web service with a Servlet 3.0 and EJB 3.1 container.

Contents

The mapping of the URI path space is presented in the following table:

URI pathResource classHTTP methodsDescription
/jersey-ejb---GETSimple html/ajax client
/jersey-ejb/app/messagesMessageBoardResourceBeanGETReturns first ten messsages
/jersey-ejb/app/messages/{id}MessageBoardResourceBeanGETReturns message with uniqueId = {id} or returns HTTP 404 if message does not exist
/jersey-ejb/app/messages/{id}MessageBoardResourceBeanDELETEDeletes message with uniqueId = {id} or returns HTTP 404 if message does not exist
/jersey-ejb/app/messages/MessageBoardResourceBeanPOSTCreates new message and allocates unique id for it (with message as request entity)

Running the Example

This sample utilizes Java EE features in the GlassFish container

Build the application WAR file by executing maven 2 from the project directory:

mvn clean package

To deploy on a running GlassFish container, you would then typically need to launch:

$AS_HOME/bin/asadmin deploy target/jersey-ejb.war

Another option is to deploy using GlassFish administrator console GUI

You can access the application at: