java - Convert JSON Object response to JSONP -
returing jsonobject right restful webservice using jersey. working fine , returning jssonobject follows.
@get @path("/logingetvalues") @produces({"application/x-javascript"}) public jsonobject getvalues(@queryparam("request") string request) { ... jsonobject value = new jsonobject(); value = null ; return value ; }
but intending convert response jsonp response , tried append callback function (as following refering ( here) not getting required response , indeed asking define @jsonp annotation . if have define callback how , have ! kindly jsonp response
@get @jsonp(queryparam="callback") @path("/logingetvalues") @produces({"application/x-javascript"}) public jsonwithpadding getvalues( @queryparam("callback") string callback ,@queryparam("request") string request) { ... jsonobject value = new jsonobject(); value = null ; return new jsonwithpadding(value , callback); }
Comments
Post a Comment