First page Back Continue Last page Text

oracle adf workshop

Notes:


Accessing One Managed Bean from Another Managed Bean

Managed beans are Java classes that you register with the application using various configuration files. When the JSF application starts up, it parses these configuration files, and the beans listed within them are made available. The managed beans can be referenced in an EL expression, allowing access to the beans’ properties and methods. Whenever a managed bean is referenced for the first time and it does not already exist, the Managed Bean Creation Facility instantiates the bean by calling the default constructor method on it. If any properties are also declared, they are populated with the declared default values.

Lookup precedence is based on memory scope. Request scope managed beans take precedence over session scope managed beans. For example, a request scope managed bean named abc in adfc-config.xml takes precedence over a session scope managed bean named abc in the current file. An instantiated bean takes precedence over a new instantiated instance. For example, an existing session scope managed bean named abc takes precedence over a request scope bean named abc defined in the current task flow definition file.