If you need to refer to a managed bean with a different name, you can create a
simple component that assigns the value of an EL-expression to a view-scoped
identifier, i.e.
<j:viewBean name="customer" value="#{my_managed_bean}/>
This will just put this mapping intot the View Root's AttributeMap, making it
available in view-scope to EL-expressions.
-----Original Message-----
From: Joshua White
Sent: Thursday, January 06, 2005 11:06 AM
To: MyFaces Discussion
Subject: RE: Scope Between Request and Session: View Scope
With this, your bean will be resolved by EL-expressions and it will last for as
long as the state of your view lasts.
-----Original Message-----
From: Joshua White
Sent: Wednesday, January 05, 2005 3:44 PM
To: MyFaces Discussion
Subject: Scope Between Request and Session: View Scope
1. Subclass UIViewRoot and give it a property AttributeMap of class HashMap.
Override saveState and restoreState to handle AttributeMap.
2. In your faces-config.xml, configure the component-type javax.faces.ViewRoot
to your subclass of UIViewRoot.
3. Subclass VariableResolver and code it to recognize "view" scope as being the
AttributeMap property of the UIViewRoot subclass from 1.
4. In your faces-config.xml file set faces-config/application/variable-resolver
to your subclass of VariableResolver.
5. Create a managed bean with managed-bean-scope set to "view"