0
我是Playframework和AngularJS的新手,并在前端的AngularJS和后端的Playframework上开发应用程序。Playframework将json值转换为表格
我面临一种情况:当用户点击菜单链接(显示学生)时,它应该显示所有的学生。在播放操作中,数据以json的形式发送。现在的问题是,如果数据是作为Json发送的,那么我看不到它应该转发到哪个页面的选项。 或者,我必须使用正常的playframework风格,例如转发到带有值列表的页面。
//This is the current playframework code I use. Here I set the values to students form
// This is not the way I want
public static Result getAllEmployees(){
List<Student> all = Student.find.all();
JsonNode json = Json.toJson(all);
return ok(views.html.students.render(all));
}
//This is the way I want
public static Result getAllEmployees(){
List<Student> all = Student.find.all();
JsonNode json = Json.toJson(all);
return ok(json); // no option for specifying the page.
}
有没有办法做到这一点?