试图让 Play 2.0 从 POJO 返回 JSON。但我收到错误
The method toJson(Writes<A>) in the type Json is not applicable for the arguments (Product)
我的代码是:
public static Result index(String date) {
Product item = new Product();
return ok(Json.toJson(item));
}
有任何想法吗?