3

I'm using a JAXB adapter... JAXBDateAdapter that formats my dates in a standard format for the JSON-consuming clients. I have a class User that has a createdOn field and it's annotated with XmlJavaTypeAdapter(JAXBDateAdapter.class) When I return any User object from my resources, everything is fine. The adapter is hit and the dates are formatted. However, I have another call that returns a map of users

@GET
Map<String, List<User>> getUsers() {  return ... }

I get back my json as

{"users" : [{ user in here }, { user in here } ]}

In this case my adapter never gets hit and the date comes back in a different form. How can I make it so that this also hits my adapter to format the dates properly?

Adrian Rodriguez
  • 3,232
  • 2
  • 24
  • 34
  • Have you solved that already? – Adrian Mitev Jul 31 '13 at 12:08
  • I think I ended up tracing through it and found that it was a problem in the json provider. When I upgraded to jackson 2.x, I think I upgraded resteasy to the latest and used the jackson-2 provider and things were ok. It's been quite a while since I looked at it so I can't say for sure, but I remember this was a path I went through. – Adrian Rodriguez Aug 08 '13 at 00:11
  • Does the XmlJavaTypeAdapter get applied when you upgraded? – Adrian Mitev Aug 08 '13 at 18:04

0 Answers0