users@jersey.java.net

[Jersey] Re: how to rename XmlRootElement in JSON

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Mon, 20 Jun 2011 11:09:28 -0700

On Thu, Jun 16, 2011 at 10:28 AM, Maxrunner <joao.rossa_at_gmail.com> wrote:
> Hi all! im trying to convert my calendar properties to another format, by
> default jackson seems to be converting to the timeinmillis value, but i want
> it to conveted as "dd/MM/YYYY" for example, im trying to use the
> @xmlJavaTypeAdapter annotation that jackson seems to support but im not
> getting the right results, it still display the calendar im milliseconds i

There is a much simpler way, try this:

mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, true);

in general, if you can avoid using JAXB annotations with Jackson,
avoid them. :-)

-+ Tatu +-