I need that controller return JSONP response.
Something like this:
jsonp123({"name" : "Remy", "id" : "10", "blog" : "http://site.com"});
I know, that PlayFramework can send response as html Template, JSON, XML… but how send JSONP response?
Thanks.
You can take a look at how it’s done for JSON (
renderJSON()throws aRenderJsonobject) and implement JSONP response in a similar way. The only difference is that you need to surround Gson output with a function call and that content type should betext/javascript.