1 Jersey, reference implementation of JAX-RS [email protected] http://blogs.sun.com/sandoz Sun Microsystems 1
1
Jersey, reference implementation of JAX-RS
[email protected]://blogs.sun.com/sandozSun Microsystems
1
Sun Confidential: Internal Only 2
HEAD /Jersey
• Open source production quality Reference Implementation> https://jersey.dev.java.net/> http://wikis.sun.com/display/Jersey/Main
• 1.0.1 in December, 1.0.2 in February> GET started> GET the JAX-RS overview guide> GET the dependencies> GET the samples
• Blogs: Paul, Marc, Jakub, Aquarium
Sun Confidential: Internal Only 3
GET /Glassfish/v3/Prelude
Sun Confidential: Internal Only 4
GET /NetBeans/6.5
Sun Confidential: Internal Only 5
GET /Samples
• Many samples are provided with the release> Atom, JAXB, JSON, Scala, Spring, WADL, …> Using GlassFish (+embedded) and Grizzly
• Download the 1.0.1 samples zip> Samples are maven-based> Works with NetBeans 6.x + maven plugin> Individual sample zip file are also available
– e.g. Sparklines, Mandel
Sun Confidential: Internal Only 6
GET /Involved
• Ask/answer questions, propose fixes/features> mailto:[email protected]
http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users
Sun Confidential: Internal Only 7
GET /Jersey-1.0.1/Client API
• The API• Easier than HttpURLConnection!• Reuses JAX-RS API• Many samples contain tests using this API• White paper will be available soon for registered
users
Sun Confidential: Internal Only 8
GET /Jersey-1.0.1/Spring API
• The API and Sample> Spring 2.0.x or 2.5.x
• XML configuration or Auto-wiring• An instance of resource class or a provider class can
be a Spring bean (AOP-proxied or not)> No explicit Jersey-based registration required
• Singleton, “prototype”, per-request or per-session scopes are supported
Sun Confidential: Internal Only 9
GET /Jersey-1.0.1/JAXB with JAXB
• The API and Sample• Better more “natural” JSON documents than using
mapped or badgerfish convention• A resource method can return XML or JSON:
@GET@Produces({“application/xml”, “application/json”})public Bean get() { Bean b = … return b
}
Sun Confidential: Internal Only 10
GET /Jersey-1.0.1/MIME multipart
• The API• Readers and writers for processing MIME multipart
messages> multipart/mixed> multipart/form-data
• Body parts reuse JAX-RS/Jersey readers/writers> JAXB could be used (XML or JSON)
Sun Confidential: Internal Only 11
GET /Jersey-1.0.next
• Jersey client API using Apache HTTP client• Atom support using Apache Abdera• Improved JAXB support with JSON• Resource specific request/response filters
• Guice 2.0 integration, when released!• WebDAV support• Comet support with Atmosphere
12
Jersey, reference implementation of JAX-RS
[email protected]://blogs.sun.com/sandozSun Microsystems
12