Java Reference
In-Depth Information
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 subdirectory will be the
name of the flow. For example, if we were developing a flow named registration ,
we would put all pages in the flow in a subdirectory called registration .
In the NetBeans project window, we can create this folder by right-clicking on Web
Pages node and then going to New | Other .
 
Search WWH ::




Custom Search