Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In the <a href="https://github.com/playframework/Play20/wiki/JavaTodoList" rel="nofollow">TodoList example</a>, the site root <code>GET /</code> is mapped to the method <code>Application.index()</code>, so this method creates the html you are seeing.</p> <p>Everything the controller does happens in this line: <code>return ok(index.render("Hello World!"));</code>. Basically it calls some templates which generate html and returns the output.</p> <ul> <li><code>return ok( ... )</code> is used to indicate a successful request, return code 200.</li> <li><code>index.render( ... )</code> returns the rendered html output of a template named <code>index</code>. The package used here is <code>views.html.*</code> but it actually refers to <code>views/index.scala.html</code>. So the <code>index</code> part is no convention, you can rename that part as you like. The template needs to get compiled before it is usable like a Java class, that's why the package names are different. The framework takes care of this.</li> <li><code>"Hello World!"</code> is the argument, as specified as <em>message</em> parameter in the very first line of <code>index.scala.html</code></li> <li><code>@play20.welcome( ... )</code> just calls another template, a <a href="https://github.com/playframework/Play20/blob/master/framework/src/play/src/main/scala/views/play20/welcome.scala.html" rel="nofollow">welcome page</a> which is included in the framework. It's not a subject to change - it's just static page, after removing that line from the view you can put any HTML you want.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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