users@jersey.java.net

[Jersey] Re: Joda DateTime

From: Paulo Pires <pjpires_at_gmail.com>
Date: Tue, 4 Feb 2014 15:43:04 +0000

Hi Robert,

Why don't you use timestamp in milliseconds (UTC) and transform with Joda
Time?

PP


On Mon, Feb 3, 2014 at 9:30 AM, Jakub Podlesak <jakub.podlesak_at_oracle.com>wrote:

> Hi Robert,
>
> There is no such Jersey feature to enable Joda DateTime as a query param
> available.
> You can however write your own JAX-RS ParamConverter provider and
> register it via
> ParamConverterProvider as documented here:
>
>
> https://jersey.java.net/apidocs/latest/jersey/javax/ws/rs/ext/ParamConverter.html
>
> HTH,
>
> ~Jakub
>
> On 02 Feb 2014, at 00:57, Robert DiFalco <robert.difalco_at_gmail.com> wrote:
>
> I'm probably being dense here but how do I use Joda DateTime as a
> QueryParam? I have the JodaModule setup with Jackson, but I guess I need
> more than that. I googled around and found solutions that required all
> kinds of code. Isn't there a JerseyFeature or some such that will allow me
> to use Joda DateTime as a QueryParam?
>
> The error I get is this:
>
> org.glassfish.jersey.server.model.ModelValidationException: Validation of
> the application resource model has failed during application
> initialization.|[[FATAL] No injection source found for a parameter of type
> public java.lang.String
> com.myapp.rest.service.DevicesResource.getExpiredDevices(org.joda.time.DateTime)
> throws java.lang.Exception
>
>
>


-- 
Paulo Pires