By sandoz on Feb 12, 2009
We have just released version 1.0.2 of Jersey, the open source, production quality, reference implementation of the JAX-RS 1.0 API. The JAX-RS specification is available at the JCP web site and also available in non-normative HTML here.
This release will be available tomorrow (12th Feb, if all goes well) from the Glassfish v2 update center, which aligns with the release of the Glassfish Portfolio that includes the GlassFish v2.1 Enterprise Server.
It will be available from the Glassfish v3 update center once we resolve some dependency issues.
To get started with Jersey read the getting started document. For an overview of JAX-RS features visit the Jersey wiki and read the overview document. To understand more about what Jersey depends on read the dependencies document. The following JavaDoc is available:
- Client, Server, WADL, JSON APIs.
- Spring integration API.
- MIME Multipart API.
- Client using Apache HTTP client API.
- Atom with Apache Abdera API.
This release has many bug fixes, you can see the change log here, as well as the following improvements and features:
- The JSON with JAXB "natural" convention.
Jakub has worked closely with the JAXB team so that the producing/consuming of JAXB to/from JSON uses information from the JAXB model. This makes for JSON from JAXB that is more "natural", easier to consume, and requires less configuration on the part of the developer. As part of this work we replaced our own JSON parsing and writing functionality with Tatu's JSON library Jackson.
For backwards compatibility we have retained the previous "mapped" convention as the default convention, but this is easy to change using the new JSON configuration, but i will leave such explanations for Jakub to blog about. In the next release we will probably deprecate the "mapped" convention.
- JSON with padding provider.
- Resource method specific filters.
I finally got around to implementing resource specific filters. Request and response filters can now be associated with sub-resource locator and resource methods. For more details see the JavaDoc here. This functionality is used to implement support for @RolesAllowed using the RolesAllowedResourceFilterFactory.
- Atom Abdera support.
Craig McClanahan has added support for producing and consuming of Atom Entry and Feed Java types of the Apache Abdera project. An injectable helper class, ContentHelper, is supplied to support the getting and setting of the content part of an Atom entry reusing the registered message body readers and writers. Craig has also provided some really nice examples showing a simple client and server. The server reuses the @RolesAllowed support for some authorization logic based on the user principal and the URI. For more details refer to the AtomPub Contacts Client and Server samples.
- Implicit produces.
With James Strachan's prompting and great help (discussions, issues and patches) i have implemented support for @ImplicitProduces on resource classes. This allows one to use the implicit model view controller approach for JSPs producing HTML as presented in the bookstore sample while allowing explicit methods for other media types say XML or JSON. Unfortunately we could not resolve some issues in time for this release, associated with the maven unit test plugin and embedded Glassfish, to update the bookstore sample.
- Servlet as a filter.
As part of James's "JAX-RS as the one Java web framework to rule them all?" i have modified the Servlet support such that one can register the Servlet artifact as a Servlet or a Filter, see here and here for more details. The advantage of the latter is that it is much easier to support filters declared before the Jersey filter that redirect to say static content or redirect to other Web frameworks. James has already provided a patch to the Jersey filter to support the returning of static content, which will be integrated into the 1.0.3-SNAPSHOT next week.
- Client using Apache HTTP client.
Jorge Williams contributed support for using the Jersey Client API with the Apache HTTP client (as opposed to using HttpURLConnection). See here for more details.
- Pavel Bucek has added support for SSL configuration of the Client API when using HttpURLConnection. See here for more details.
For the next release, 1.0.3, scheduled for March/April 2009, we plan to include the following contributions (these were previously considered for 1.0.2 but were not stable enough):
- Guice 2.0 integration.
Gili Tzabar has contributed Guice support as a patch and we continue to refine this. The patch will go into the 1.0.3-SNAPSHOT next week. It is understood that the Guice 2.0 APIs are stable and i have found a maven repository where Guice 2.0 snapshot jars are available. This should give us enough time between now and the 1.0.3 release to refine the support.
- Test framework.
Naresh has been working hard on the jersey test framework in another branch. Unfortunately it was not quite ready for the 1.0.2 release and we need to depend on a stable API for embedded Glassfish, which is currently being designed. Once the framework is in place it will allow us to write tests that are capable of being deployed on different containers.
For feedback send email to:
or log a bugs/features here.