On 6/1/06, Dennis Byrne <[EMAIL PROTECTED]> wrote:
>As long as you don't also have a "sharedData" bean in request scope, this
>will pick up the session scoped bean for you (and also create it if
>necessary, if it is a managed bean).

Hi Craig,

I can only see how the first part is correct.  If sharedData is a data structure in session scope (not in a JSF sense), it should behave the same.

Right.

  But if sharedData is a session scoped managed bean, I don't think the impl should create it - it should throw an exception at runtime because geographyProducer is a request scope managed bean.

That's where you have it wrong.  Your "geographyProducer" bean is in request scope, right?  It's perfectly legitimate to inject an instance of a session scoped managed bean into a request scoped managed bean, since the session scoped bean has a longer lifetime.  Therefore, the _expression_ "#{sharedData}" should indeed create a managed bean instance if "sharedData" is defined as a session scoped managed bean.

It is the *opposite* direction that is prohibited ... you cannot inject a request scoped bean into a session scoped bean.
 

>Craig

Dennis Byrne

Craig
 


Reply via email to