播放框架 @routes.Assets.at 编译错误
2022-09-01 05:06:34
我正在使用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
所以。。。任何帮助将不胜感激。