Book Image

Mastering JavaServer Faces 2.2

By : Anghel Leonard
Book Image

Mastering JavaServer Faces 2.2

By: Anghel Leonard

Overview of this book

Table of Contents (20 chapters)
Mastering JavaServer Faces 2.2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
The JSF Life Cycle
Index

Dependent pseudo-scope


This is the default scope of a CDI bean (@Named) when nothing is specified. In this case, an object exists to serve exactly one bean and has the same life cycle as that bean; an instance of a dependent scoped bean is not shared between different users or different points of injection. It can also be explicitly specified by annotating the bean with the @Dependent annotation and importing javax.enterprise.context.Dependent. This scope is available only in CDI and is the only non-contextual scope.

Note

All CDI scopes, except this one, are known as normal scopes. More details about normal scopes versus pseudo-scopes can be found in the Normal scopes and pseudo-scopes section at http://docs.jboss.org/cdi/spec/1.0/html/contexts.html.

If you put the PlayersBean in the dependent scope, then the current extracted player and the list of randomly extracted players (which will be empty or will contain this player) is available only inside the bean, as shown in the following code...