The view scope

The view scope lives as long as you are navigating in the same JSF view in the browser window/tab.

The view scope is useful when you need to preserve data over multiple requests without leaving the current JSF view by clicking on a link, returning a different action outcome, or any other interaction that dumps the current view. It gets created upon an HTTP request and gets destroyed when you postback to a different view; as long as you postback to the same view, the view scope is alive.

Note

Notice that the view scope bean might get passivated by the container and should be capable of passivity by implementing the java.io.Serializable interface.

Since the view scope is particularly useful when you are editing some objects while staying ...

Get Mastering JavaServer Faces 2.2 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.