First page Back Continue Last page Graphics

Using Managed Properties


Notes:

Using Managed Properties

Managed properties are bean variables that are exposed through setter and getter methods for write and read access. All variables not explicitly set as managed properties retain the default values upon bean instantiation.

The <managed-property> element represents an individual property of a managed bean. A managed property calls the equivalent setter method of the bean on bean initialization

The <managed-property> element is nested within the <managed-bean> element. Managed properties must have a name and a value. Optionally they can have a property class, a description, a display name and an icon. The last three elements are for tools to display the property and have no meaning for the JSF application at run time.

The property class doesn’t need to be mentioned for simple types, as JSF will figure this out.

Although null is among the possible values for a managed property, it is allowed only if the property is an object. This means that null cannot be used for types of int, boolean, and so on.