@(title:String)

Browse

Contents

Search

Get help with google

@title

Congratulation, you've just created a new Scala Play application. This page will help you in the few next steps.

Why do you see this page?

The conf/routes file defines a route that tell play to invoke the Application.index action when a browser requests the / URI using the GET method:

# Application home page
GET     /         Application.index

So play has invoked the controllers.Application.index method:

package controllers

import play._
import play.mvc._

object Application extends Controller {

    import views.Application._

    def index = {
        html.index("Your Scala application is ready!")
    }

}

The action returns the HTML content generated by the views.Application.html.index template. This template is defined in the app/views/Application/index.scala.html file:

@@(title:String)

@@main(title) {

    @@views.defaults.html.welcome(title)

}

This template extends the app/views/main.scala.html template, and call views.defaults.html.welcome to display this welcome page.

Need to connect to a database?

You can quickly set up a developement database (either in memory or written to the filesystem), by adding one of these lines to the conf/application.conf file:

# For a transient in memory database (H2 in memory)
db=mem

# for a simple file written database (H2 file stored)
db=fs

If you want to connect to an existing MySQL5 server, use:

db=mysql:user:pwd@@database_name

If you need to connect to another JDBC compliant database, first add the corresponding driver library to the lib/ directory of your application, and add these lines to the conf/application.conf file:

db.url=jdbc:postgresql:database_name
db.driver=org.postgresql.Driver
db.user=root
db.pass=secret

Need more help?

When your application run in DEV mode, you can access directly the current documentation at the /@@documentation URL or go to http://www.playframework.org.

The Scala specific documentation is available at /@@documentation/modules/scala/home

The Play Google Group is where Play users come to seek help, announce projects, and discuss. If you don't have any google account, you can still join the mailing list sending an email to
play-framework+subscribe@@googlegroups.com.