How To Practise An Event Edible Bean Inward Javaee6 Using Its Class

JavaEE6 has actually revolutionize the evolution using CDI (from seam) exactly at that spot are times when nosotros require to practice an instance of a course of teaching non past times injection exactly past times other way such equally Component.getInstance from seam.

In seam nosotros convey something similar
MyClass myClass = (MyClass) Component.getInstance("MyClass"); 

In JavaEE6, nosotros practice that by:
Bean edible bean = (Bean) beanManager.getBeans(MyClass.class).iterator().next(); CreationalContext ctx = beanManager.createCreationalContext(bean); provide (MyClass) beanManager.getReference(bean, MyClass.class, ctx); 
 

I role this type of approach unremarkably amongst FacesConverters.
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.