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 ...
Get Java EE 7 Development with NetBeans 8 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.