相关疑难解决方法(0)

Play Framework @ routes.Assets.at编译错误

我正在使用Play 2.4.0并且我一直在尝试按照主页中的教程:https: //playframework.com/,这是针对Play 2.3以及解决了有关Ebean ORM更改的几个问题之后版本2.3到2.4,我遇到以下错误:

Compilation error

value at is not a member of controllers.ReverseAssets
Run Code Online (Sandbox Code Playgroud)

我的index.scala.html:

@(message: String)

@main("Welcome to Play") {

    <script type='text/javascript' src="@routes.Assets.at("javascripts/index.js")"></script>

    <form action="@routes.Application.addPerson()" method="post">
        <input type="text" name="name" />
        <button>Add Person</button>
    </form>

    <ul id="persons">
    </ul>
}
Run Code Online (Sandbox Code Playgroud)

我的routes档案:

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET         /                    controllers.Application.index()

POST        /person              controllers.Application.addPerson()

GET         /persons             controllers.Application.getPersons()

# Map static resources from the /public …
Run Code Online (Sandbox Code Playgroud)

java playframework java-8 playframework-2.4

36
推荐指数
1
解决办法
2万
查看次数

标签 统计

java ×1

java-8 ×1

playframework ×1

playframework-2.4 ×1