Hi Ivan On Mon, Apr 11, 2011 at 3:19 PM, Ivan Vitoria Sanchez <[email protected] > wrote:
> Hi Sergey, > > The problem is that my method returns T, which is resolved by > XMLGregorianCalendar instead of Date. > > Is this method a JAX-RS resource method ? Or is it part of the JAXB bean class ? I don't think returning a Date directly from a resource method would work with JAXBElementProvider Adding a @XmlJavaTypeAdapter to the method with a custom XmlAdapter causes a > JAXBException (unexpected element). > > Can you provide more info please ? thanks, Sergey > Ivan > > > -----Mensaje original----- > De: Sergey Beryozkin [mailto:[email protected]] > Enviado el: lunes, 11 de abril de 2011 12:45 > Para: [email protected] > Asunto: Re: Using Date instead of XmlGregorianCalendarImpl > > Hi Ivan > > You have to add an adapter, please see > > http://blogs.sun.com/CoreJavaTechTips/entry/exchanging_data_with_xml_and > > for an example. > > JAXBElementProvider won't check package-level adapters, at the moment > you'll > probably need to add it to a method returning a Date. I'll see what has be > improved for package-level adapters be checked too > > Cheers, Sergey > > On Mon, Apr 11, 2011 at 9:25 AM, Ivan Vitoria Sanchez < > [email protected] > > wrote: > > > Hello, > > > > > > > > Is there any way to configure (via Spring) the JAXB provider in order to > > use > > "Date" instead of "XmlGregorianCalendarImpl" in the JAX-RS server? I'm > > having XmlGregorianCalendarImpl instances when using a class which extend > > from a generic type class and specifying Date as the type in my subclass. > > > > > > > > Many thanks, > > > > > > > > Ivan > > > > > > > > > -- Sergey Beryozkin Application Integration Division of Talend <http://www.talend.com> http://sberyozkin.blogspot.com
