Thursday, December 27, 2007

Ext Reader for Jersey Web Services

I just started exploring the impressive Ext JavaScript framework. It is very easy to work with and supports a number of options for getting data into your Web 2.0 applications. I also started experimenting with Jersey, the reference implementation for JSR 311 RESTful web services. After playing with both for a couple of days, I thought I would try using the two together, easier said than done.

Creating new a new data driven web service is easy when using the wizards that come with the Netbeans RESTful Web Services plugin. There is an excellent tutorial titled 'Getting Started with RESTful Web Services' on the Netbeans site to help you get started. The resources created by the wizards allow one to select the data format by setting the HTTP request header's 'Accept ' field to 'application/json' or 'application/xml' depending on the need. JAXB converter classes are also created by the wizards to simplify formatting the data as JSON or XML.