• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

ParamConverterProvider for client side i.e. <jaxrs:client… providers

 
Ranch Hand
Posts: 44
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to convert Java 8 LocalDate in client side received from REST Service in JSON form. I read about  ParamConverterProvider, but looks like it works only for REST resource methods i.e. server side.
Is there any thing to convertt LocalDate on client side.

I tried implementing ParameterHandler<LocalDate> and registered it in jaxrs:client providers. I can see constructor is called , but not the method 'fromString'. Am I missing anything ?
Below is my implementation:

 
Client stub file:



Please note that I am able to fetch JSON string If I invoke resource directly from browser. SO only issue is my JavaLocalDateParamHandler "fromString" method is not called during conversion.

Does it work only on server side where REST resources(i.e. methods with diff annotations) are present
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!