How can Guice's @RequestScoped be done with Play 2.6

六眼飞鱼酱① 提交于 2019-12-12 14:04:23

问题


I need the authenticated User, to access REST services.

My idea is to have an IdentityService that is RequestScoped and can be injected by all REST service clients.

The setup is like: Controller -> BusinessLogic -> RESTServiceClient

So to passing the User down would involve lots of code.

As Guice's @RequestScoped is not supported (https://groups.google.com/forum/#!msg/play-framework/MEOAhdOJz5Q/-cukqS-ZBAAJ)

How can this be done with Play?

The Problem is also described here (without a solution so):

Current Request/User details in Models in Scala Play! 2.5

来源:https://stackoverflow.com/questions/51281807/how-can-guices-requestscoped-be-done-with-play-2-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!