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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access