I'm on Play Framework 2.5.14, with play for java.
I have a Service that loads and processes some data, and it takes a long time to process that data.
I'm doing it this way:
Controller
public Result showData() {
List<Data> data = service.getProcessedData();
return ok(views.html.data.render(data));
}
View
@(data: List[Data])
<!-- html code -->
But when I go to the page it is in blank a long time because service.getProcessData()
takes too long. When the function finish, then the view is rendered.
What I need is for the view to load and when the data is ready, fill the view.