title: What is a managed bean and how many should I use per page?
body: <p>I am working on a Web-application using JavaServer Faces.</p>
  
  <p>I have found many examples and tutorials on how to use JavaServer Faces, but none of them actually explain what a Bean is used for. My initial thoughts were, that Beans represent forms. You enter data into your form and click the submit button and the associated Bean is filled with the data and a method is called.</p>
  
  <p>However, so far I have only seen examples where there is one Bean per page, so a Bean could also represent a page and thus contain multiple forms.</p>
  
  <p>I am also confused about the scope of a Bean. If the Bean represents a form or a page, it should become invalid after the request ended. If you make the bean live in the scope of the session, what happens to the Bean? Are you still able to somehow get the data out of it or will it just fill the associated form for you once you go back to it?</p>
  
  <p>In summary - what is a Managed Bean and how do you use it properly?</p>