I posted a reply on Stackoverflow. In short: you don't need to
inject DateTime. Just use it as a normal method parameter and it'll work.
Gili
On 21/11/2012 2:17 PM, Jeremy Johnson wrote:
>
> Ah, thanks, Gili.
>
> Looks like I left out the link to my question on Stack Overflow:
>
> http://stackoverflow.com/questions/13482909/using-joda-datetime-as-a-jersey-parameter
>
> The code in your link provides Jackson support for Joda, but doesn't
> provide for injection of Joda DataTime objects as Jersey query params,
> unless I'm missing something.
>
> Thanks!
>
> Jeremy
>
> *From:*cowwoc [mailto:cowwoc_at_bbs.darktech.org]
> *Sent:* Tuesday, November 20, 2012 6:34 PM
> *To:* users_at_jersey.java.net
> *Subject:* [Jersey] Re: Provider for Joda's DateTime?
>
> On 20/11/2012 5:43 PM, Jeremy Johnson wrote:
>
> I'd like to accept Joda's DateTime objects as query parameters and
> understand that some flavor of injectable provider is needed.
>
> Joda's DateTime is so ubiquitous, I was surprised to not find an
> implementation already out there beyond a couple of partial
> implementations on this list.
>
> Does anyone have a working, reliable implementation they'd care to
> share? I also posted this to Stack Overflow, if you'd like to
> duplicate your response there as well for cred.
>
> Thanks,
>
> Jeremy
>
>
> It depends what resource representation format you're using. If
> you're using JSON with the Jackson library this will work:
> https://github.com/FasterXML/jackson-datatype-joda
>
> PS: Where is the Stackoverflow question? :)
>
> Gili
>