我正在使用带有 Scala 的 Play 框架。我面临一个奇怪的错误,无法弄清楚解决方案是什么。错误信息是:
value Track 不是对象 controllers.routes.javascript 的成员
<script type="text/javascript" src="@routes.TrackController.javascriptRoutes"></script>
@helper.javascriptRouter("jsRoutes")(
routes.javascript.Track
)
def Track(id:Long)= Action {implicit request =>
Ok(views.html.track(
new TrackData(TrackClient.getTrack(id))))
}
def javascriptRoutes = Action { implicit request =>
Ok(
Routes.javascriptRouter("jsRoutes") (routes.javascript.TrackController.Track)).as("text/javascript")
}
#JavaScriptRouting
GET /track/:id @controllers.TrackController.Track(id: Long)
GET /javascriptRoutes @controllers.TrackController.javascriptRoutes
新的错误是:
1@(message: String)
2
3@main("Welcome to Play 2.1") {
4
5 @play20.welcome(message)
6
7}
第 3 行的 index.scala.html。在此处找不到任何 HTTP 请求标头
它说 index.scala 但我从未更改过它。