Returing a JSONObject right now from a restful webservice using Jersey. Its working perfectly fine and returning a JSSONObject as 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 to convert that response into JsonP response , tried to append that with a callback function (as the following refering ( here) but then not getting the required response , indeed its asking to define the @JSONP annotation . Also if i have to define the callback then how and where i have to do that ! Kindly help to get a 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);
}