users@jersey.java.net

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

From: nbaliga <nbaliga_at_cleartrial.com>
Date: Fri, 17 Feb 2012 05:12:34 -0800 (PST)

After I upgraded to Jackson 1.9, I started seeing the quotes on numbers
despite having explicitly set the WRITE_NUMBERS_AS_STRINGS to false (the
default is also false).

Previously, when I was on Jackson 0.9, the numbers appeared without the
quotes.

In both cases, the Jersey version is 1.5.

With Jackson 0.9, I was supplying a JaxbContextResolver via
/
@Component
@Provider
public class JAXBContextResolver
      implements ContextResolver<JAXBContext>
{...

/

With Jackson 1.9, I am supplying Jackson ObjectMapper via
/
@Component
@Provider
public class JacksonObjectMapperProvider
      implements ContextResolver<ObjectMapper>
...
/

But like I mentioned Jackson 1.9 on it's own doesn't quote numbers.

--
View this message in context: http://jersey.576304.n2.nabble.com/In-JSON-output-how-do-you-write-a-number-as-a-number-and-not-as-a-string-tp7292424p7294133.html
Sent from the Jersey mailing list archive at Nabble.com.