Last week, I was working on a semi-commercial project where we are using Jersey. I didn't find too much documentation, but Jersey is open-source and the samples are pretty self-explaining.
Jersey is the Reference Implementation for JSR 311 (Java API for RESTful Web Services). I was impressed by a Jersey presentation at JavaOne --- see one of my older blogposts --- for a couple of reasons:
1. It is out of the box available in GlassFish v3 (at least in b49, but I think it is in the preview as well). Works fine on GlassFish v2 as well, but I copied the jars from my v3-install into my v2.1 install. 2. Netbeans 6.5.1 has support for Jersey. 3. The REST protocol is used in a growing number of publicly available webservices.
4. For some of the projects we do at LodgON, third parties need to integrate with some Java backend code that we provide. A REST interface is almost always warmly welcomed.
5. Our programming model that mixes page reloads and Ajax requests becomes easier.
It is often not clear in the beginning of a project what the best approach is for a particular data-operation: loading a new page, or using Ajax. Typically, during the iterations that precedes the deliverable, requirements change and what was originally a page refresh should all of a sudden be an Ajax call.
We solved this in a number of cases by using a request parameter format which could be either "HTML" or "XML". But this leads to rather ugly tests in the servlet request processing methods.
This is only one of the advantages of Jersey. While using Jersey, I discovered other nice features, I will discuss some of them in future blog posts.
written on 26 Jun 2009 22:07.Create comment