Dennis Byrne wrote:
The spec says higher scoped managed beans cannot be injected into lower scoped
managed beans. This doesn't mean we can't inject session scoped data into
request scope managed beans ...
<managed-bean>
<managed-bean-name>geographyProducer</managed-bean-name>
<managed-bean-class>gov.blm.ak.GeographyConsumerThread</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>sharedData</property-name>
<value>#{facesContext.externalContext.sessionMap['sharedData']}</value>
</managed-property>
</managed-bean>
Dennis Byrne
Well, in my opinion, this is exactly what the spec says.
http://wiki.apache.org/myfaces/AccessingOneManagedBeanFromAnother
<cite>
The constraints are that:
* the using bean must have scope which is the same as or shorter than
the needed bean
* the using bean must have a property-setter method which takes the
needed bean as a parameter
* the beans cannot have managed dependencies on each other.
</cite>
In your example geographyProducer is the using bean and has shorter
scope (request) than the session scoped bean, whatever way you use to
access it.
Best regards
Ondrej Svetlik