users@jersey.java.net

Re: [Jersey] primitive types - best response format ??

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Fri, 1 May 2009 09:01:54 -0700

2009/5/1 Felipe Gaúcho <fgaucho_at_gmail.com>:
> when I want to return Java primitive types, what is the best media
> type ? or other response type ?
>
> like:
>
> @GET
> @Produces( { MediaType.TEXT_PLAIN })
> @Path("/count")
> public String count() {
> return Long.toString(userFacade.count());
> }

Text/plain seems good... but you might as well return plain old int or
long from the method itself? Or are those not automatically converted
yet?

-+ Tatu +-