I'm a start in CDI.
To test CDI. I created 2 classes.
public class Exam {
@Inject
private Student student;
private int examCode;
@PostConstruct
private void init(){
System.out.println("Init in Exam");
this.setExamCode(11);
}
}
public class Student {
private String name;
@PostConstruct
public void init(){
System.out.println("Init in Student");
this.name = "John Eipe";
}
}
Isn't it possible to do this in Servlet's doGet.
Exam exam = new Exam();
System.out.println(exam);
But I don't see Injection happening.
--
View this message in context:
http://openejb.979440.n4.nabble.com/TomEE-and-CDI-tp4669131.html
Sent from the OpenEJB User mailing list archive at Nabble.com.