加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

播放Scala应用程序“未找到:值行动”

发布时间:2020-12-16 10:02:06 所属栏目:安全 来源:网络整理
导读:我按照文章 http://scala.playframework.org/documentation/scala-0.9.1/hello-world中的说明操作 我安装了Typesafe Stack 1.1和Play! Framework 2.0 beta. 当我将文件index.scala.html修改为 @(message: String)@main("Welcome to Play 2.0 beta") { form
我按照文章 http://scala.playframework.org/documentation/scala-0.9.1/hello-world中的说明操作

我安装了Typesafe Stack 1.1和Play! Framework 2.0 beta.

当我将文件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>
}

页面无法编译,找不到错误消息:值操作.
我已经确定它也无法与其他帮助程序一起编译.我用谷歌搜索解决方案而没有想出任何东西.我是Scala的新手,非常感谢任何帮助.

解决方法

我刚刚开始玩游戏和scala我发现游戏2.0不是一个东西
应该从.

在游戏2.0中似乎缺少很多,而且很多教程都是为了播放1.x.例如,我在播放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>

}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读