Like many other web frameworks, JSF separates the user interface from the model objects that encapsulate data and application logic. When the HTML user interface is generated with the JSF tags, the JSF framework gets the data from the JavaBean model and sets the state of the UI components that make the HTML form. When the user submits the form, JSF validates the user input. If everything is okay, JSF stores the user input in the JavaBean model and the HTTP request can be forwarded to another page following a navigation rule. If there are validation errors, JSF returns the form with error messages, so that the user can correct the input errors. This sample demonstrates XML fragment contains the declarations related to the JavaBean that is managed by JSF:

Code of the sample bean:

 package test;

public class SampleBean implements {

    private String _text ;
    public String getText() { return _text ; }
    public void setText(String text) { _text = text; }

 <!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"


////////////// a definition of a managed bean, its class and scope:

////////////// the list of managed properties;
////////////// we have the only property - text: