[webbeans-dev] How does JSF deal with managed beans when Web Beans/299 is present?

Pete Muir pmuir at redhat.com
Tue Aug 4 07:54:54 EDT 2009


On 4 Aug 2009, at 04:43, Dan Allen wrote:

>
>
>
> We should state that it's possible to inject a managed or enterprise  
> bean into a JSF managed bean because the injection, as you said, is  
> based on the EL.
>
> Why? If you are using 299 you aren't using JSF managed beans. If you  
> are aren't using 299 then this isn't relevant.
>
>
> If the injection goes the other way, the instance is the one created  
> by JSR-299 and not the instance created by JSF; an important point  
> to understand. Therefore, there could be two instances of a bean per  
> scope. And from what you proposed, the JSR-299 bean always wins if  
> it has the same name as a JSF managed bean.
>
> Again, no, if 299 is active *it* manages the beans, so there are no  
> JSF managed beans.
>
> I'm saying if both containers are allowed to instantiate beans, you  
> would be in this situation. So if you can get JSF managed beans to  
> be disabled, then yes, 299 will manage the beans. But if we don't  
> lay down some rules, then we will be in a situation where both  
> containers are creating beans. That's all I'm saying.

I think it's better to address this by disabling JSF managed beans  
when 299 is present, rather than by creating extra rules about how the  
two interact. Any reason to take the latter approach?



More information about the weld-dev mailing list