我正在从Pluralsight做一个Play2和Scala教程。
我创建了一个默认项目,我这样配置:
controller Application.scala
package controllers
import play.api._
import play.api.mvc._
class Application extends Controller {
def index = Action {
Ok(views.html.index("Hello, again, world!"))
}
}
查看index.scala.html
(@message: String)
<!doctype html>
<html>
<head>
<title>
Play 2 for Scala!
</title>
</head>
<body>
<h1>
@message
</h1>
</body>
</html>
我的路线档案中有以下路线:
GET / controllers.Application.index
我的问题是,当我尝试访问http://localhost:9000/
时,我得到:
too many arguments for method apply: ()play.twirl.api.HtmlFormat.Appendable in class index
6class Application extends Controller {
7
8 def index = Action {
9 Ok(views.html.index("Hello, again, world!"))
10 }
11
12}