我正在使用 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
我的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>
}
还有我的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 folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
我有同样的例子在 Play 2.3.9 上工作正常
而且我看不出在 2.4.0 的文档中使用公共资产有什么不同:https ://www.playframework.com/documentation/2.4.0/Assets
所以......任何帮助将不胜感激。