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

Chapter 3. JSF Scopes – Lifespan and Use in Managed Beans Communication

If programming is an art, then working correctly with scopes is a part of it!

This affirmation is generally true, not just in JSF. Should I use the session scope now, or the request scope? Do I have too many session beans? Can I inject this scope into that scope? Is this session object too big? How many times have you asked yourself these kinds of questions? I know ... many times! Maybe in this chapter you will find answers to some of these questions and you will fortify your knowledge about working with JSF scopes.

We have a lot to accomplish; therefore, let's have a short overview of what you will see in this chapter:

  • JSF scopes versus CDI scopes

  • Request scope, session scope, view scope, application scope, conversation scope, flow scope, none scope, dependent scope, and custom scope

  • Beans injection