users@jersey.java.net

Returning basic data types in Jersey

From: Rohan Sahgal <rohansahgal_at_gmail.com>
Date: Wed, 4 Jun 2008 21:35:05 -0700

I was just about getting started with Jersey.
I went through the examples in the distribution.

I have one question though, how do you return a basic data type(such as
int,float,double,etc) when you use Jersey.
I see a couple of examples for returning custom data types (Entity Provider
and JsonFromJaxb) but how do I go about returning an int without converting
it to a String.

Specifically I was thinking of exposing some counters through Jersey so that
they can be accessed elsewhere. Now all these counters have a get that
returns an int, how do i annotate them to make it work in jersey. I cant
change the method signature because some other code already calls these get
methods.

Any help will be highly appreciated.

Thanks,
Rohan