2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

What is the default scope of a named CDI bean of JSF

What is the default scope of a named CDI bean of JSF
userimage

This pseudo-scope means that an object exists to serve exactly one client (bean) and has the same lifecycle as that client (bean). This is the default scope for a bean which does not explicitly declare a scope type.

  • An instance of a dependent bean is never shared between different clients or different injection points.
  • It is strictly a dependent object of some other object.
  • It is instantiated when the object it belongs to is created, and destroyed when the object it belongs to is destroyed.

All predefined scopes except @Dependent are contextual scopes. CDI places beans of contextual scope in the context whose lifecycle is defined by the Java EE specifications.


e.g A session context and its beans exist during the lifetime of an HTTP session. Injected references to the beans are contextually aware. The references always apply to the bean that is associated with the context for the thread that is making the reference.The CDI container ensures that the objects are created and injected at the correct time as determined by the scope that is specified for these objects

Answer is