i am working on project using play 2 framework with java. I want to populate a drop down list from a database table. I have this code that gets a list of the items from the database. the code snippet is shown below.
public static Result gestureNames()
{
List <GestureClassEntity> gcet = GestureClassEntity.find.all();
return ok(render(gcet));
}
however when i run this code play framework tells me that it cannot find render.
i have tried to modify the code which i have shown below
public static void gestureNames()
{
List <GestureClassEntity> gcet = GestureClassEntity.find.all();
render(gcet);
}
play tells me again that it cannot use a method returning Unit as an Handler
still struggling to understand the play framework can some kindly help me out. Cos i am working on a project and time is running out.
Remember previous question? https://stackoverflow.com/a/12180812/1066240
render()is method of theview, so to use it, you need to specify theviewapp/views/gestures.scala.htmlBTW: try to simplify your enigmatic models’ names, your life will be better. Can’t be
GestureClassEntitynamed just asGesture???