Thanks Ondrej.
No prob about the warning - this is the intended behavior; bean B
continues a scenario with data constructed by bean A. (no going back
& forth)
--> setting the var once in B after A has done it's work is fine.
Also Bean B only gets instantiated after Bean A has populated this
var. (should have - still debugging ;-)
Bye,
Wolf
On 30 May 2006, at 12:15, Ondrej Svetlik wrote:
Wolf Benz wrote:
Thanks but... this is what I knew so far :-)
What I want is not sharing an ENTIRE bean, just ONE variable. (a
managed property)
Is this possible as well?
Thought of these 2 possibilities: (donno whether it would work/
whether at least one of them is correct)
<managed-bean>
<managed-bean-name>A</managed-bean-name>
<managed-bean-class>...</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>B</managed-bean-name>
<managed-bean-class>...</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>beanB_varA</property-name> <!-- Name of
the very same var in bean B-->
<value>#{beanA.varA}</value> <!-- referencing this
way allowed?-->
</managed-property>
</managed-bean>
Hello Wolf,
I thing the first method should work, but! This will almost sure set
the property while instantiating the session bean. It means that
those beans will share one instance. When you use still the same
instance it will be all right. When you change the instance in A it
won't be shared with B any more. B will still have the old instance.
That's my opinion.
This would mean that sharing int, boolean or other scalar type
variables would never work this way.
Best regards
Ondrej Svetlik