Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Faces flows


Traditional web applications are stateless, that is, a page that just loaded in the browser has no idea of what data the user was working on in previous pages. Java web application frameworks have worked around this inherent limitation of web applications by storing states on the server and attaching Java classes to different application scopes. JSF does this by using the appropriate scope annotation on CDI named beans, as described earlier in this chapter.

If we need to share data between exactly two pages, a scope of request is what we need. If we need to share data across all pages in the application, then a scope of session makes sense. However, what if we need to share data across three or more web pages but not with all pages in the application? There wasn't an appropriate scope we could use until JSF 2.2 added the flow scope.

Since all pages in a flow are related to each other, all pages in the flow must be placed in the same subdirectory. By convention, the name of the...