"be.objectify" %% "deadbolt-java" % "2.4.3"
文件中添加built.sbt
后,在application.conf
文件中添加:
play {
modules {
enabled += be.objectify.deadbolt.java.DeadboltModule
}
}
而且当我实现HandlerCache时,它说无法解析HandlerCache。并在运行项目时在图像中显示以下错误。
答案 0 :(得分:0)
您需要将处理程序暴露给Deadbolt。创建一个绑定处理程序缓存的模块并将其添加到application.conf中
示例新模块:
public class SecurityHook extends Module{
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(bind(DeadboltHandler.class).to(SecurityHandler.class).in(Singleton.class),
bind(HandlerCache.class).to(SecurityHandlerCache.class).in(Singleton.class));
}
}
application.conf:
play.modules {
enabled += be.objectify.deadbolt.java.DeadboltModule
enabled += security.SecurityHook
}