2

What is the architectural purpose of the "view state" in JSF?

I understand that it stores the original state of the components on the page and is used during the JSF lifecycle when the FacesServlet receives a request. But why is it needed? What if the view state did not exist?

BestPractices
  • 12,738
  • 29
  • 96
  • 140

1 Answers1

4

What if the view state did not exist?

The view would then not be mutable from the server side on. For example, you won't be able to attach/remove an UIComponent programmatically.

It's however quite possible to make JSF entirely stateless. See also this blog article.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I also found your other post (which is linked to in the "Why does... server side?" page you reference) useful as well: http://stackoverflow.com/questions/7349174/why-does-jsf-save-component-tree-state – BestPractices Feb 17 '12 at 20:11