[Jersey] In JSON output how do you write a number as a number and not as a string?

From: nbaliga <>
Date: Thu, 16 Feb 2012 13:26:24 -0800 (PST)

I upgraded to Jackson 1.9.

I am using Jersey 1.5.

I have set up a Provider to provide a Jackson ObjectMapper instance that I
have configured with the following property:

public class JacksonObjectMapperProvider
      implements ContextResolver<ObjectMapper>
objectMapper.configure( JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS,
false );

I have also set up the initParam enabling the POJOMappingFeature in my

I am now noticing that numbers are being serialized in JSON, with quotes.

I tried a test case using the same ObjectMapper provider and the numbers get
serialized without any quotes.

This implies that Jackson is doing what it's supposed to when used on it's
own, but somehow the Jersey + Jackson combination is causing numbers to be

Any clues?

View this message in context:
Sent from the Jersey mailing list archive at