在 2.5 版本之前,我在表单对象中使用应用程序静态注入(inject)器,让这些对象负责自己的验证和持久性机制(使用注入(inject)工厂),以使该逻辑远离 Controller 对象。
但是,
play.Play.application().injector().instanceOf(MyInterface.class);
现已弃用,我想知道如何在表单 bean 中获取注入(inject)实例,因为无法在调用 bindFromRequest() 之前设置值。
感谢您的任何提示...
最佳答案
在 Play 2.5 中是:
Play.current().injector().instanceOf(MyInterface.class);
关于java - Play Framework 2.5 表单对象 bean 中的依赖注入(inject) (Java),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37696470/