CDI - Injecting objects dynamically at runtime
问题 How do I inject objects at runtime? For example, if I want to inject DerviedOne, DerivedTwo objects at runtime into the Test class in the following example, how do I do that? I found a few examples in Spring, but I'm not using Spring. This is a Dynamic Web Project with CDI using Java EE 6. public abstract class Base { public Base(String initiator) { this.initiator = initiator; } public abstract void process(); public void baseProcess() { System.out.println("base process"); process(); } public