Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding the "Welcome to Play 2.0" page creation
    text
    copied!<p>I have just started to try to work with the play framework and tried to understand this default application you get when creating a new project.</p> <p>So as far as I understand, when loading the localhost page, a http get request comes in and is directed to the <code>Application.index()</code> method because of the specification in the routes file? In the <code>index()</code> method a lot of HTML code is generated and returned in a Result object and passed to the <code>index.scala.html</code> file which hands it over to the <code>main.scala.html</code> where it is surrounded with more html.</p> <p>Now, a few things are unclear to me:</p> <ul> <li><p>in <code>Application.java</code> there is this line <code>return ok(index.render("Hello World!"));</code> index belongs to <code>views.html.*</code>; but where is this package? I can't find it in the API :(</p></li> <li><p>why can't I rename the <code>index.scala.html</code> file? Is the name a convention?</p></li> <li><p>in the <code>index.scala.html</code> file itself: what does <code>@play20.welcome(message, style = "Java")</code> do? is this getting the "Welcome to Play 2.0" site? and again - I can't find the documentation/API entry for the play20 thing :(</p></li> </ul> <p>I hope, somebody can help me to get an overview, as I am really confused at the moment..^^ I have done a lot of java, but no web programming at all, therefore this mix of all the different technologies and languages is quite strange at the moment!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload