play2 scala と play2 javaの差分

play2 new で作成したプロジェクトについて、 scalajavaの差分を確認する。

app/controllers/Application.java and Application.scala

1c1
< package controllers;
---
> package controllers
3,4c3,4
< import play.*;
< import play.mvc.*;
---
> import play.api._
> import play.api.mvc._
6,8c6
< import views.html.*;
< 
< public class Application extends Controller {
---
> object Application extends Controller {
10,12c8,10
<     public static Result index() {
<         return ok(index.render("Your new application is ready."));
<     }
---
>   def index = Action {
>     Ok(views.html.index("Your new application is ready."))
>   }
14c12
< }
---
> }

app/views/index.scala.html

<<<<<<< HEAD
    @play20.welcome(message, style = "Java")
=======
    @play20.welcome(message)
>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

conf/application.conf

<<<<<<< HEAD
# So for an application router like `conf/my.application.Router`,
# you may need to define a router file `my.application.routes`.
# Default to Routes in the root package (and `conf/routes`)
=======
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (and conf/routes)
>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

<<<<<<< HEAD
#
# You can expose this datasource via JNDI if needed (Useful for JPA)
# db.default.jndiName=DefaultDS
=======
>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

<<<<<<< HEAD
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
# ebean.default="models.*"

=======
>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

conf/routes

<<<<<<< HEAD
GET     /                           controllers.Application.index()
=======
GET     /                           controllers.Application.index
>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

project/Build.scala

<<<<<<< HEAD
    javaCore,
    javaJdbc,
    javaEbean
  )

=======
    jdbc,
    anorm
  )


>>>>>>> 66a5c72a09c86b5566629de3caf3316be3c966d6

最後にHeroku へのデプロイ用の Procfile ファイルは Play1 と異なる

Play2: web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS}

Play1: web: play run --http.port=${PORT} ${PLAY_OPTS}