users@jersey.java.net

Re: [Jersey] jersey+jaxb+json 115 date encoding drops 0 millis

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 02 Jun 2010 11:46:23 +0200

Hi Tony,

The following may help:

   http://blogs.sun.com/CoreJavaTechTips/entry/exchanging_data_with_xml_and

Search for DateAdapter.

Paul.

On Jun 2, 2010, at 10:55 AM, Tony Nys wrote:

> Hi all,
> We're using jersey/json (1.1.5) on the server and gwt on the client.
> When jersey/jaxb encodes a java.util.date to a string, the
> milliseconds are dropped of if it the time had exactly 0 milliseconds.
> This causes a datetimeformat parse error in gwt since mostly the
> millis are there ".000" but in extreme situations it can be without
> any or with eg. ".20" in stead of ".200".
>
> We need a way to ALLWAYS have ".xxx" even if it is ".000"
>
> Is there a Jaxb annotation (we don't map to xsds) to specify the
> default dateformat ? Because if there is we can even drop the millis
> totally since we are not needing them at client side.
>
> Thanks
>
> Tony
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>