users@jersey.java.net

Re: [Jersey] XmlJavaTypeAdapter when using JSON

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 05 Dec 2008 18:26:16 +0100

Hi,

Did you verify if your DateAdapter is getting invoked or not when
unmarshalling from JSON?

What are the JSON configuration options you are using?

The default JSON configuration uses a specific JSON XMLStreamReader
implementation. It should not matter from JAXBs perspective in terms
of applying the XmlAdapter but may be it is a character decoding
issue... hard to say...

If you are not using the default JSON configuration i would be curious
to know if it works for you using say the mapped jettison
configuration, which is using a different XMLStreamReader
implementation.

If you have time sending a simple reproducible example would be very
helpful.

Paul.

On Dec 5, 2008, at 5:46 PM, sarat.pediredla wrote:

>
> I have a custom DateAdapter which extends XmlAdapter to convert
> dates to and
> from ISO 8601 date format to use Ruby-like timestamps when XML and
> JSON is
> rendered and read.
>
> It all seems to work fine when "reading" data and the ISO 8601 date
> renders
> fine in both XML and JSON modes. However, when "posting" a new
> object, ISO
> 8601 dates only seem to work in XML and not JSON.
>
> I was wondering if this is because of the XmlJavaTypeAdapter and if
> this is
> not being triggered when unmarshalling JSON objects? Any views?
> --
> View this message in context: http://n2.nabble.com/XmlJavaTypeAdapter-when-using-JSON-tp1619181p1619181.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>