【发布时间】:2014-12-15 10:02:04
【问题描述】:
我正在尝试在控制器中使用安全助手,如 Security.scala 的源代码所示
我的代码看起来像
import play.mvc.Security.Authenticated
Application extends Controller {
..... some other Actions
def isAuthenticated(f: => String => Request[AnyContent] => Result) = {
Authenticated { user =>
Action(request => f(user)(request))
}
}
}
但是,我收到以下编译错误
[info] Compiling 1 Scala source to /home/venki/play/lrs/target/scala-2.11/classes...
[error] /home/venki/play/lrs/app/controllers/Application.scala:119: object play.mvc.Security.Authenticated is not a value
[error] Authenticated { user =>
[error] ^
[error] one error found
[error] (compile:compile) Compilation failed
我无法理解错误。从源代码中我可以看到 Security 对象包含两个名为 Authenticated 的重载方法。我已经完全复制粘贴了作为示例用法给出的代码,但它仍然不起作用。非常感谢任何帮助
【问题讨论】: