[webbeans-dev] Re: Context.get with mismatched scopes

Gavin King gavin.king at gmail.com
Wed May 6 22:31:24 EDT 2009


Hrm, this issue is on my list, but I don't think I will do anything about it.

On Fri, Jan 30, 2009 at 3:59 PM, David Allen <drallendc at gmail.com> wrote:
> Hi Gavin,
>
> I was just writing some tests and realized the spec in section 8.1 does
> not clearly state what happens if I use a context from one scope and a
> bean from a different scope.  Should this be a runtime exception?
>
> Example:
>
> @Dependent
> public class MyBean {}
>
> ...
>
> Bean myBean = manager.resolveByType(MyBean.class).iterator().next();
> MyBean myBeanInstance =
> manager.getContext(SessionScoped.class).get(myBean);
>
> -------------
> David Allen
> david.allen at acm.org
>
>
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org




More information about the weld-dev mailing list