java - JODA LocalDate as QueryParam of Jersey -
i search google lot, find answer complicated , not compatible joda version 2.3.
i'm required use localdate queryparam in jersey service, localdate not supported queryparam valid data type.
is there other annotation or workaround deal localdate queryparam?
@get @path("/available") public list < availableclient > getavailable(@queryparam(value = "client") clientdto client, @queryparam(value = "from") localdate from, @queryparam(value = "to") localdate to) { return client.get(from, to); }
here's error: [[fatal] no injection source found parameter of type public
you can receive date long value , create localdate this.
@get @path("/available") public list < availableclient > getavailable(@queryparam(value = "client") clientdto client, @queryparam(value = "from") long from, @queryparam(value = "to") long to) { return client.get(new localdate(from), new localdate(to)); }
if realy need receive localdate queryparam, need create paramconverter. not simple, prefer long option because can use long every date api in java.
here example of paramconverter.
Comments
Post a Comment