RESTfulなサーバを建てたいと思った時に使うのがJersey。 さて、RESTなだけで、やっぱりクロスドメインとか対応させないとね―。 ということでjsonp対応の方法。 @Path("/jsonget") @GET public JSONWithPadding getMethod(@Context HttpServletRequest request, @QueryParam("callback") @DefaultValue("callback") String callback){ //適当に返却する情報を生成 Object resultObj = ・・・; //返却したいオブジェクトを元にJSONWithPaddingを生成 return new JSONWithPadding(resultObj, callback); }これだけ。 これだけで、リクエストによってJSONかJ