Bean instance of a shorter scope injected in a bean instance of a larger scope in CDI - how does it work?

后端 未结 1 1484
离开以前
离开以前 2020-12-29 06:06

Consider the following request-scoped CDI bean:

@RequestScoped
public class RequestScopedBean {
    // ...
}

Now, I inject it in a applicat

1条回答
  •  爱一瞬间的悲伤
    2020-12-29 06:53

    In CDI each injected object is actually a proxy. So in that case, the proxy probably holds a reference to the RequestContext and on each method invocation gets the correct bean instance.

    0 讨论(0)
提交回复
热议问题