vum*_*sha 2 scala playframework-2.3
我试图在控制器内使用安全助手,如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))
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下编译错误
[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
Run Code Online (Sandbox Code Playgroud)
我无法理解错误.从源代码中我可以看到Security对象包含两个名为Authenticated的重载方法.我完全复制粘贴了作为示例用法给出的代码,但它仍然无法正常工作.很感谢任何形式的帮助
| 归档时间: |
|
| 查看次数: |
170 次 |
| 最近记录: |