Is it possible to use an html page as a representation in game environment 2?

I am new to Play 2.0. I try to look for patterns, but always keep getting Scala templates as a representation for content direction, is it possible to just use a pure HTML file without Scala as a view? How do you ask the Controller action method to direct it to this html file?

+4
source share
1 answer

First put your HTML files in the public folder, for example:

 public | ├── html | └── hello.html 

And then you can serve static HTML files in several ways using the asset controller :

Or by accessing the file directly in Url: http://localhost:9000/assets/html/hello.html

Or using the routes file to map the URL to your file. In the routes file add:

 GET /hello controllers.Assets.at(path="/public", file="html/hello.html") 

Then log in to Html using http://localhost:9000/hello

+10
source

Source: https://habr.com/ru/post/1494854/


All Articles