Main

Welcome to the Community Wiki for Project Jersey!

Project Jersey is an open source community that is building the production quality reference implementation of JSR-311: JAX-RS - Java API for RESTful Web Services. Jersey implements support for the annotations defined in JSR-311, making it easy for developers to build RESTful web services with Java and the Java JVM. Besides implementing the JSR-311 API, Jersey provides an additional API not specified by JSR-311 so that developers can extend this JSR to suit their specific needs. This wiki contains information for the developers using Jersey, for the developers improving Jersey, and for the people with a general interest in RESTful Web Services.

We hope that you will find the Jersey Wiki to be a valuable informational resource. We actively encourage you to become a contributor and share your knowledge about Jersey and RESTful Web Services with the rest of the open source community. Contributors to existing or new wiki topics only need to have a registered user id and some knowledge they'd like to share.

If you're new to Jersey and/or RESTful Web Services, and are unable to find the information you need on this wiki page, please leave us a comment and we'll do our best to find the answer and add it to the wiki so that it will be available to all.

What are RESTful Web Services?

RESTful Web services are services that are built to work best on the Web.

Representational State Transfer (REST) is an architectural style that specifies constraints, such as the uniform interface, that if applied to a Web service induce desirable properties, such as performance, scalability and modifiability, that enable services to work best on the Web.

In the REST architectural style, data and functionality are considered resources, and these resources are accessed using Uniform Resource Identifiers (URIs), typically links on the web. The resources are acted upon by using a set of simple, well-defined operations. The REST architectural style constraints an architecture to a client-server architecture, and is designed to use a stateless communication protocol, typically HTTP. In the REST architecture style, clients and servers exchange representations of resources using a standardized interface and protocol. These principles encourages RESTful applications to be simple, lightweight, and have high performance.

To find out more about REST, try these sources for more information:

Get Started

  1. Read the getting started document on how to develop your first simple JAX-RS application with Jersey.
  2. Read the JAX-RS Overview of JAX-RS 1.0 Features for many details of the JAX-RS API and deployment using Jersey.
  3. Read the dependencies document to understand how to use Jersey with maven and the Java.Net maven repository.
  4. Check out the samples that ship with Jersey. For more info on the examples, see the section below.
  5. Read the blogs (referenced below) or read the Jersey FAQ for information on more advanced topics.
  6. Read the Jersey Tutorial, also known as the RESTful Web Services Developers Guide. The PDF version can be downloaded here. This tutorial contains the following topics:
    1. Chapter 1: Introduction to RESTful Web Services and Jersey
    2. Chapter 2: Installing Jersey and the Jersey Sample Applicatons
    3. Chapter 3: Creating a RESTful Resource Class
    4. Chapter 4: Creating, Deploying, and Running Jersey Applications
    5. Chapter 5: Jersey Sample Applications
  7. Follow the Jersey Hands-On Lab

Learn More

Example Applications

The sample applications, which are listed below, can be downloaded here.

  • HelloWorld: This is how everybody starts using Grizzly as in the process HTTP server.
  • HelloWorld Web app: This is how everybody starts using a Web application.
  • Bookmark Web app: Demonstrates how to use JPA in the backend.
  • Bookstore Web app: Demonstrates how to use polymorphism with resources and views that are JSP pages.
  • EntityProvider: Demonstrates pluggable entity providers.
  • Extended WADL Web app:Demonstrates how to customize generation of WADL.
  • Generate WADL: Demonstrates how to customize generation of WADL.
  • Jaxb: Demonstrates the use of JAXB-based resources.
  • JMaki-backend Web app: Provides JSON to be consumed by jMaki widgets.
  • JsonFromJaxb: Demonstrates how to use JSON representation of JAXB-based resources.
  • Mandel: A Mandelbrot service written in Scala using Scala's actors to scale-up the calculation.
  • OptimisticConcurrency: Demonstrates the application of optimistic concurrency to a web resource.
  • SimpleAtomServer:Simple Atom server that partially conforms to the Atom Publishing Format and Protocol.
  • SimpleConsole: Demonstrates a simple service using Grizzly.
  • SimpleServlet: Demonstrates how to use a Servlet container.
  • Sparklines: A sparklines application inspired by Joe Gregorio's python application.
  • Spring annotations: An example leveraging Jersey's Spring-based annotation support.
  • StorageService: Demonstrates a basic in-memory web storage service.

Here are a few other examples. Please add any others to the list that you find useful.

General Information

  • Schedule - Planned features and Jersey release dates

For Jersey Users

  • External Links - Links to articles and blogs containing samples and hints for using Jersey
  • WADL - What does jersey provide related to WADL and how this can be used

For Jersey Developers

What are Folks from the Open Source Community Saying About JAX-RS and Jersey?

Labels

web web Delete
design design Delete
basics basics Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Oct 16, 2007

    t.wiik says:

    An example page with links would be nice, e.g.: http://blogs.sun.com/arungupta/...

    An example page with links would be nice, e.g.:

    http://blogs.sun.com/arungupta/entry/learn_to_rest_using_jersey

    1. Jun 13, 2008

      sandoz says:

      My apologies for the very late reply. I have added a link to the getting started...

      My apologies for the very late reply. I have added a link to the getting started page on the Jersey java.net page.

  2. Jun 10, 2008

    kwilliaa says:

    There should be a clearly visible list of base requirements either here or on a ...

    There should be a clearly visible list of base requirements either here or on a separate page (FAQ?)

    ie. JavaSE6, Servlet 2.3 etc...

    1. Jun 13, 2008

      sandoz says:

      I have added a "What are the dependencies to the FAQ"

      I have added a "What are the dependencies to the FAQ"

  3. Oct 01, 2008

    asherwin says:

    I commend the ease of which the examples can be quickly tried, using the built-i...

    I commend the ease of which the examples can be quickly tried, using the built-in lightweight http server or NB project. But what about people who are not using NetBeans and wish to deploy it in some other configuration (stand-alone WAR, WAR inside an EAR where all the libs are part of the EAR libs.. etc)

    I've been finding it quite difficult actually to find any concrete information on what kind of setup is required in the web.xml to accomplish my needs (none of the info I have found has come from the Jersey docs, site or Wiki)

    Maybe the examples should contain dual distributions (one to run stand-alone through the Main class w/ built-in lightweight http, and one that builds a standard WAR that should be able to be deployed on any EE5 container [note: that does not require usage of the build\-impl.xml from the nbproject])

    1. Oct 02, 2008

      sandoz says:

      From your description i suspect that you are using an older distribution before ...

      From your description i suspect that you are using an older distribution before we switched over to using Maven.

      Have you see the following sample:

      http://download.java.net/maven/2/com/sun/jersey/samples/helloworld-webapp/1.0-ea-SNAPSHOT/helloworld-webapp-1.0-ea-SNAPSHOT-project.zip

      If you build this then a war is created you can deploy in an app server. There are a number of web-based samples provided.

      I have also just written this (as part of a larger overview document):

      http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features#OverviewofJAX-RS1.0Features-DeployingaRESTfulWebservice

      Does this help?

  4. Jan 07, 2009

    Junfeng says:

    Need help for running Bookmark sample using Netbeans & Glassfish V2/V3. Tha...

    Need help for running Bookmark sample using Netbeans & Glassfish V2/V3.
    Thanks in advance !

    1. Jan 08, 2009

      jakub.podlesak says:

      @Junfeng: the bookmark example works only with GlassFish V2. You should be able ...

      @Junfeng: the bookmark example works only with GlassFish V2. You should be able to simply run it from NetBeans6.5,
      if you have a GFv2 instance registered at your NetBeans as it works for me now (using the trunk version of the example). I am not sure about a need to manually configure the jdbc connection pool using the GFv3 admin interface, so if your NB complains during deployment, please look at the example's README.html doc and configure jdbc before you try to redeploy.

      1. Jan 08, 2009

        Junfeng says:

        Thanks a lot, Jakub. Before I guessed GFv3 had Jersey plugin, and GFv2 didn't.

        Thanks a lot, Jakub.
        Before I guessed GFv3 had Jersey plugin, and GFv2 didn't.

  5. Apr 05, 2009

    JalpeshPatadia says:

    I have been using jersey for the past two weeks and am pretty excited about it's...

    I have been using jersey for the past two weeks and am pretty excited about it's use in my project. Having said that, there is one area where I'm stumbling - and could not find a satisfactory answer searching the wiki. Basically I need to modify my generated xml (from the annotated JAXB pojo's which are consumed by JAX-RS servlet) to include a processing instruction like <xsl-stylesheet>.

    In JAXB, it's possible (using the marshaller object), but since I don't have access to it, I was wondering if there's a way I can somehow inject that in the generated xml.

    Thanks, and sorry if this is not the right place for this question - I didn't find a forum for asking question. If there is, feel free to move it there.

    Thanks,

    Jalpesh.

    1. Apr 06, 2009

      sandoz says:

      Hi Jalpesh, See here: If you need more help please email: users@jersey.de...

      Hi Jalpesh,

      See here:

      If you need more help please email:

      users@jersey.dev.java.net

      Paul.

      1. Apr 07, 2009

        JalpeshPatadia says:

        Thanks Paul, I think that resolved my issue. I'm hitting another error right no...

        Thanks Paul,

        I think that resolved my issue. I'm hitting another error right now, but that's with using the SpringServlet. I'll email the above mentioned address with the error.

        --- Jalpesh.

  6. Apr 17, 2009

    paskos says:

    I've been looking for a jersey forum where I can ask question and didn't find it...

    I've been looking for a jersey forum where I can ask question and didn't find it, is there one ?

    1. Apr 20, 2009

      sandoz says:

      Send email to: users@jersey.dev.java.net you can use Nabble forum if you wish...

      Send email to:

      users@jersey.dev.java.net

      you can use Nabble forum if you wish:

      http://n2.nabble.com/Jersey-f576304.html

      Paul.

  7. Nov 02

    sTiVo says:

    As usual, client-side samples get short shrift. I just want to write a simple b...

    As usual, client-side samples get short shrift. I just want to write a simple backend client of someone else's RESTful Web Service. I'm sure I can dig it up but a sample would be nice.

    1. Nov 03

      sandoz says:

      Many of the samples have unit tests that utilize the Client API and are designed...

      Many of the samples have unit tests that utilize the Client API and are designed to show how that API can be used:

      http://download.java.net/maven/2/com/sun/jersey/samples/jersey-samples/1.1.2-ea-SNAPSHOT/jersey-samples-1.1.2-ea-SNAPSHOT-project.zip

      https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/client/package-summary.html

      Also see the following white paper:

      http://www.sun.com/offers/details/Java_Jersey_Client.xml

      And see Jakub's example:

      http://blogs.sun.com/japod/entry/jersey_does_contain_a_client

      If you have any questions send email to users@jersey.dev.java.net

      Paul.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact