users@jersey.java.net

[Jersey] Re: Adding versioning support in jersey rest

From: Conal Christopher Tuohy <conal.tuohy_at_versi.edu.au>
Date: Sun, 3 Jul 2011 23:39:42 +0000

Umesh, I know it's irritating to ask 'how do I do X?' and get a reply "don't!", so please accept my apologies for suggesting you don't version your URIs ;-)

Recall that in RESTful HTTP, resources are identified by URI, and 'cool' URIs don't change, so if your new version API deals with the same things as the old version, then it should use the same URIs to identify those things.

In the RESTful architecture, most of the complexity lies not in the URIs but in the resource representations. I think you'll probably find it makes more sense, and is easier, to version these; i.e. to add support for a new Content-Type to your resource classes, with new methods dispatching on the 'Accept' header.

Regards

Conal


Umesh Bhatt <umesh_bhatt_at_mindtree.com> wrote:


Hi,

I want to add version support in my rest web service and want to achieve as mentioned below. Please let me know how to achieve it.

In URL I want to add QueryParam version and based on this value want to call correct resource. For this I want to create Http request interceptor to check version info and call appropriate resource.
Please let me know how to do this.

Thanks,
Umesh

________________________________

http://www.mindtree.com/email/disclaimer.html