You expect to be able to send some data back to the View itself in web applications; this is quite straightforward with Play Framework. A Play View template is simply a text file that contains directives, web markup tags, and template tags. The
View Template files also follow standard naming conventions and they are placed in predefined directories within the Play project directory, which makes it easier to manage template files.
For Java, we need to take the following steps:
foo_javaapplication with Hot-Reloading enabled.
foo_java/app/views/. Add the contents of the view file:
@(products: Collection[String]) <h3>@products.mkString(",")</h3>