如何禁用playframework的反向路由?

时间:2016-10-23 21:47:01

标签: playframework playframework-2.5

我想在playframework中禁用反向路由。我该怎么做?

注意:我正在使用Play! 2.5.9

我尝试了以下内容:

PlayKeys.generateRefReverseRouter := false

然后我收到以下错误:

error: value generateRefReverseRouter is not a member of object 
play.sbt.Play.autoImport.PlayKeys
PlayKeys.generateRefReverseRouter := false
         ^
[error] Type error in expression

我也尝试过设置:

RoutesKeys.generateReverseRouter := false

会产生以下错误:

ERROR: object RoutesPrefix is not a member of package router

1 个答案:

答案 0 :(得分:2)

对于2.5.x,RoutesKeys位于play.sbt.routes._。查看mainline

以下内容适用于2.5.9(build.sbt): -

import play.sbt.routes._

RoutesKeys.generateReverseRouter := false