• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[jersey/jax-rs] json object value string has extra quotes, jsonp, service chaining‏

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My short question is why does my jsonp response have an extra set of quotes around the json object, my second is how do I fix it. I'm so close to it all working.

I am returning a jsonp response from two different approaches. The first is by using jaxb annotation objects, this works well. (see callback1)
The second is by wrapping/chaining another external rest service into a string and returning the reponse as below using Client, this doesn't work (callback2). I think my problem is in the string and the jaxb object queryResult's String result property.
 
Stuart Swearengen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[SUM]

String s = "{\"ABCD\" : 123}";
JSONObject o = new JSONObject();
o.put("result", new JSONObject(s));
return new JSONWithPadding(o, callback);

works as I needed.
full answer is available on jersey.dev.java.net if you want to know more
 
reply
    Bookmark Topic Watch Topic
  • New Topic