播放2.4 migration:JavascriptReverseRoute is not member of object play.core.Router错误

Play 2.4 migration:JavascriptReverseRoute is not a member of object play.core.Router error

我是 scala play 框架的新手,我已将此 JavascriptRoute.scala 文件用于 AJAX 在 play 2.3.9 中调用,并且运行良好。

package controllers

import play.api.Routes
import play.api.mvc.Action
import play.api.mvc.Controller
import play.api.mvc.EssentialAction
import play.core.Router.JavascriptReverseRoute
import play.core.Router._
import routes.javascript.Application.index
import routes.javascript.Organizations.ajaxCallOrgStatus
//import routes.javascript.Users.ajaxCallForDomain
import routes.javascript.Users.domainMap

object JavascriptRoute extends Controller {

  /* Application related JavascriptReverse Route will goes here */
  val appRoutes: List[JavascriptReverseRoute] = List(index,ajaxCallOrgStatus,domainMap)

  /* All JavascriptReverse Route will combine here */
  val javascriptRouters = appRoutes

  /**
   * This is used to generate JavascriptReverseRoute for all provided actions
   *
   * @return
   */
  def javascriptRoutes: EssentialAction = Action { implicit request =>
    import routes.javascript._
    Ok(Routes.javascriptRouter("jsRoutes")(javascriptRouters: _*)).as("text/javascript")
  }
}

当我迁移到玩 2.4 框架时它显示以下错误

[错误] D:\my-app\app\controllers\JavascriptRoute.scala:7: 值 JavascriptReverseRoute 不是对象 play.core.Router 的成员 [错误] 导入 play.core.Router.JavascriptReverseRoute [错误] ^ [错误] D:\my-app\app\controllers\JavascriptRoute.scala:17: 未找到:类型 JavascriptReverseRoute [错误] val appRoutes: List[JavascriptReverseRoute] = List(index,ajaxCallOrgStatus,domainMap)

我试图修复播放 2 的导入语句。4.x 但我找不到此导入的替代方法 play.core.Router.JavascriptReverseRoute.

已移至play.api.routing下:

https://www.playframework.com/documentation/2.4.3/api/scala/index.html#play.api.routing.JavaScriptReverseRoute