[webbeans-dev] Context.get with mismatched scopes

David Allen drallendc at gmail.com
Fri Jan 30 15:59:02 EST 2009


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





More information about the weld-dev mailing list