JSF web application itself has 4 types of scopes: application, session, request and none; ADF technology has brought 3 additional types of scopes: page flow, view and backing bean. The most common ones being used across an ADF fusion application are request, page flow, view and backing bean. Though placing a managed bean into a bigger scope than it should be will still work for your application most of the time but will bring cost on the overhead, placing the bean the other around will definitely stop your application from working properly.
If you are working on the ADF fusion application, the developer's guide should the first resource to refer. The following table list 3 locations of registering your managed bean and their rules of thumb:
|Managed Bean Placement||Effect|
|Task flow definition file|
Additionally, the guide says:
As a general rule for Fusion web applications, a bean that may be used in more than one page or task flow, or one that is used by pages within the main unbounded task flow (
adfc-config), should be registered in the
adfc-config.xmlconfiguration file. A managed bean that will be used only by a specific task flow should be registered in that task flow's definition file. There should be no beans registered in the
The most common mistakenly setup of managed bean scopes in an ADF fusion application are:
- A bean is used in more than one page or task flow and registered in one of the task flow definition files
- A bean for page fragment in a task flow is not put into the backing bean scope.
- Put a common accessible bean into faces-config.xml
- Put a bean in adfc-config.xml and choose the scope as "PageFlowScope"
- Put a bean in a bigger scope than it should.