Managed Beans (also known as model objects and controllers) are lightweight container-managed objects (POJOs) with minimal requirements.
They support a small set of basic services, such as:
Components in a page are associated with managed beans that provide application logic. A managed bean is created with:
Each of the managed bean properties can be bound to one of the following:
The most common functions that managed bean methods perform include the following:
In a managed bean, a property consists of:
package hello;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class Hello {
final String world = "Hello World!";
public String getworld() {
return world;
}
}
When bound to a component’s value, a bean property can be any of the basic primitive and numeric types or any Java object type for which the application has access to an appropriate converter. For example, a property can be of type Date if the application has access to a converter that can convert the Date type to a String and back again.