播放Scala应用程序“;未找到:值操作“;

播放Scala应用程序“;未找到:值操作“;,scala,playframework,playframework-2.0,Scala,Playframework,Playframework 2.0,我遵循文章中的说明 我已经安装了Typesafe Stack 1.1和Play!框架2.0测试版 当我将index.scala.html文件修改为 @(message: String) @main("Welcome to Play 2.0 beta") { <form action="@action(controllers.Application.index)" method="GET"> <input type="text" name="myName

我遵循文章中的说明

我已经安装了Typesafe Stack 1.1和Play!框架2.0测试版

当我将index.scala.html文件修改为

@(message: String)

@main("Welcome to Play 2.0 beta") {
    <form action="@action(controllers.Application.index)" method="GET">
        <input type="text" name="myName" /> 
        <input type="submit" value="Say hello!" />
    </form>
}
@(消息:字符串)
@main(“欢迎玩2.0测试版”){
}
页面编译失败,错误消息为
未找到:值操作

我已经确定它也无法与其他助手一起编译。我在谷歌上搜索了一个解决方案,但什么也没想到。我对Scala完全陌生,非常感谢您的帮助。

我刚开始玩,Scala我发现play 2.0不是一个好东西 我们应该从这开始

Play2.0似乎有很多不足之处,而且很多教程都是针对Play1.x的。例如,我在play eclipify上浪费了一些时间,只是在一个bug档案中发现play 2.0中没有实现这种“舒适性”。因此,我建议您使用play 1学习scala

在教程中的步骤中(游戏1的教程,我不知道游戏2的教程),您应该更改:

controllers.Application.index  to  controllers.Application.sayHello
添加到contollers.scala

def sayHello = html.sayHello(params.get("myName"))
添加此文件
helloworld/app/views/Application/sayHello.scala.html:

@(name:String)

  @main(title = "Hello") {

  <h1>Hello @(name ?: "Guest")!</h1>

  <a href="@action(controllers.Application.index)">Back to form</a>

}
@(名称:字符串)
@main(title=“你好”){
你好@(名字?:“客人”)!
}

er。。。“你知道Play2.0还在测试版吗?”佩雷·维莱加:“是的,这就是为什么我不建议从它开始。学习新框架时,我需要舒适感和教程。所以我认为最好使用1,直到2退出测试版并实现“舒适性”。Play 2.0处于测试版,与1.x完全不同,不要尝试使用Play 1.x的教程和Play 2.0,它不会起作用。坚持玩游戏1.x学习:)