Java Reference
In-Depth Information
Setting Up the Jersey JAX-RS Implementation
Problem
You want to work with JAX-RS so that you can build RESTful applications in a standard Java
fashion.
Solution
Get Jersey, available from https://jersey.dev.java.net .
Discussion
Jersey is a Maven 2 project, so you can get the JARs, sources, and JavaDocs all from the
Maven repository at http://download.java.net/maven/2/com/sun/jersey .
NOTE
If you use NetBeans 6 or better, Jersey IDE support is available as a plug-in. Just go to Tools→Plu-
gins and check if it's there. If it is, you should be able to create a Hello World-type project by navig-
ating to New Project→Samples→RESTful Web Services→Hello World.
The JavaDoc for JAX-RS is available at https://jsr311.dev.java.net/nonav/javadoc/index.html .
The JavaDoc for the Jersey implementation is available at https://jersey.dev.java.net/source/
browse/*checkout*/jersey/tags/jersey-1.0/api/jersey/index.html .
NOTE
You can use any servlet container, such as Tomcat 6, to run Jersey (and these examples). As long as
you have made the necessary servlet mapping (shown below) and included all of the necessary JARs
on the classpath, you won't have any problems.
Dependencies
It will be easier to integrate Jersey into your project if you're using Maven 2. That's because
Jersey has a variety of runtime dependencies, including:
▪ The core server.
▪ The core client.
Search WWH ::




Custom Search