I have Play framework 2.0.4 installed. For the java app I have, I want to render response in JSON format.
But when I was using renderJSON, compiler gives:
The method
renderJSON(Map<String,String>)is undefined for the type Status
what am I missing here?
public class Status extends Controller {
public static void myMethod(String url) {
Map<String, String> map = new HashMap<String, String>();
map.put("id", "1069");
map.put("url", url);
renderJSON(map);
}
}
I guess you are trying to port an application from version 1 to 2? In Play 2, this is how you return a JSON response:
You should also have a look at the documentation.